:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(data-warehouse): resume paused CDC source without a re-sync (#71560)
Daniel RCe33c527d9a28
diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.tsindex 139e48516910..561544109bf8 100644--- a/frontend/src/lib/api.ts+++ b/frontend/src/lib/api.ts@@ -6018,6 +6018,7 @@ const api = {publication_exists?: booleanlag_bytes?: number | nullpublished_tables?: string[]+ schedule_paused?: boolean}> {return await new ApiRequest().externalDataSource(sourceId).withAction('cdc_status').get()},diff --git a/products/data_warehouse/backend/facade/api.py b/products/data_warehouse/backend/facade/api.pyindex 31db7192488c..fc286d0ee021 100644--- a/products/data_warehouse/backend/facade/api.py+++ b/products/data_warehouse/backend/facade/api.py@@ -38,6 +38,7 @@ _LAZY = {"external_data_workflow_exists": "logic.data_load.service","is_any_external_data_schema_paused": "logic.data_load.service","is_cdc_enabled_for_team": "logic.data_load.service",+ "is_cdc_extraction_schedule_paused": "logic.data_load.service","is_custom_source_ai_builder_enabled_for_team": "logic.data_load.service","pause_cdc_extraction_schedule": "logic.data_load.service","pause_external_data_schedule": "logic.data_load.service",diff --git a/products/data_warehouse/backend/logic/data_load/service.py b/products/data_warehouse/backend/logic/data_load/service.pyindex 2d68ec19ce6b..4d3355950740 100644--- a/products/data_warehouse/backend/logic/data_load/service.py+++ b/products/data_warehouse/backend/logic/data_load/service.py@@ -36,6 +36,7 @@ from posthog.temporal.common.schedule import (a_update_schedule,create_schedule,delete_schedule,+ describe_schedule,pause_schedule,schedule_exists,trigger_schedule,@@ -588,6 +589,23 @@ def unpause_cdc_extraction_schedule(source_id: str) -> None:raise+@async_to_sync+async def is_cdc_extraction_schedule_paused(source_id: str) -> bool:+ """Whether the source's CDC extraction schedule exists and is currently paused.++ A missing schedule reads as not paused — there is nothing to resume.+ """+ schedule_id = _get_cdc_extraction_schedule_id(source_id)+ temporal = await async_connect()+ try:+ desc = await describe_schedule(temporal, schedule_id=schedule_id)+ except temporalio.service.RPCError as e:+ if e.status == temporalio.service.RPCStatusCode.NOT_FOUND:+ return False+ raise+ return desc.schedule.state.paused++@async_to_syncasync def bulk_sync_cdc_extraction_schedules(source_intervals: list[tuple[ExternalDataSource, timedelta]],diff --git a/products/data_warehouse/backend/presentation/views/external_data_source.py b/products/data_warehouse/backend/presentation/views/external_data_source.pyindex c437f281ab49..cac877308074 100644--- a/products/data_warehouse/backend/presentation/views/external_data_source.py+++ b/products/data_warehouse/backend/presentation/views/external_data_source.py@@ -84,6 +84,7 @@ from products.data_warehouse.backend.facade.api import (github_repositories_for_job_inputs,is_any_external_data_schema_paused,is_cdc_enabled_for_team,+ is_cdc_extraction_schedule_paused,is_custom_source_ai_builder_enabled_for_team,is_multi_schema_capable_sql_source,reconcile_github_repositories,@@ -97,6 +98,7 @@ from products.data_warehouse.backend.facade.api import (sync_discover_schemas_schedule,sync_external_data_job_workflow,trigger_external_data_source_workflow,+ unpause_cdc_extraction_schedule,)from products.data_warehouse.backend.facade.models import ExternalDataSourceRevenueAnalyticsConfigfrom products.data_warehouse.backend.presentation.views.external_data_schema import (@@ -4006,6 +4008,107 @@ class ExternalDataSourceViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixireturn Response(status=status.HTTP_200_OK, data={"success": True, "schemas_reset": schemas_reset})+ @extend_schema(+ request=None,+ responses={+ 200: OpenApiResponse(+ response={"type": "object", "properties": {"success": {"type": "boolean"}}},+ description="CDC resumed; the extraction schedule is unpaused.",+ ),+ 400: OpenApiResponse(+ description="CDC not enabled, the slot/publication were lost (use Repair CDC), the source is still "+ "unreachable, or unpausing failed."+ ),+ },+ )+ @action(methods=["POST"], detail=True)+ def resume_cdc(self, request: Request, *arg: Any, **kwargs: Any):+ """Resume a CDC source whose extraction schedule was paused by a non-retryable+ failure that left the replication slot intact (bad credentials, SSL/host errors).++ Once the user has fixed the root cause, this re-probes the source DB — confirming+ the connection now succeeds and the slot/publication still exist — then unpauses the+ extraction schedule so streaming resumes from where it left off. No re-snapshot, so+ it's the cheap counterpart to Repair CDC. If the slot/publication are actually gone+ (``cdc_broken``, or a live probe showing them missing), resume is refused — only+ Repair CDC can recreate them, at the cost of a full re-sync.+ """+ instance: ExternalDataSource = self.get_object()++ adapter, err = self._get_cdc_adapter_or_400(instance)+ if err is not None:+ return err+ assert adapter is not None # narrowed by _get_cdc_adapter_or_400++ cdc_config = adapter.parse_cdc_config(instance)+ if not cdc_config.enabled:+ return Response(+ status=status.HTTP_400_BAD_REQUEST,+ data={"message": "CDC is not enabled on this source."},+ )++ cdc_schemas = list(+ ExternalDataSchema.objects.filter(+ source=instance,+ sync_type=ExternalDataSchema.SyncType.CDC,+ should_sync=True,+ ).exclude(deleted=True)+ )+ if not cdc_schemas:+ return Response(+ status=status.HTTP_400_BAD_REQUEST,+ data={"message": "No schemas are syncing via change data capture, so there is nothing to resume."},+ )++ # A broken source has lost its slot/publication — resuming would just re-fail on the+ # next tick. Route the user to Repair CDC, which recreates them (and re-syncs).+ if any((schema.sync_type_config or {}).get("cdc_broken") for schema in cdc_schemas):+ return Response(+ status=status.HTTP_400_BAD_REQUEST,+ data={"message": "The replication slot or publication was lost. Use Repair CDC to recreate it."},+ )++ # Re-probe the source: this both re-validates the connection (a still-wrong password+ # raises here) and confirms the slot/publication survive, so we never unpause straight+ # back into the same deterministic failure.+ try:+ live_status = adapter.get_status(instance)+ except (OperationalError, BaseSSHTunnelForwarderError, SSLRequiredError) as e:+ return Response(+ status=status.HTTP_400_BAD_REQUEST,+ data={+ "message": f"Could not connect to source to resume CDC — check the credentials and try again: {e}"+ },+ )+ except Exception as e:+ capture_exception(e, {"source_id": str(instance.id), "team_id": self.team_id})+ return Response(+ status=status.HTTP_400_BAD_REQUEST,+ data={"message": f"Could not connect to source to resume CDC: {e}"},+ )++ if live_status.get("slot_exists") is False or live_status.get("publication_exists") is False:+ return Response(+ status=status.HTTP_400_BAD_REQUEST,+ data={"message": "The replication slot or publication is missing. Use Repair CDC to recreate it."},+ )++ try:+ # Recreate the schedule if it was deleted out-of-band — unpausing a missing schedule is a+ # silent no-op that would report success while CDC never runs (same ordering as CDC repair's+ # _resume_schedules). sync builds an unpaused schedule; the explicit unpause covers the+ # already-existing-but-paused case.+ sync_cdc_extraction_schedule(instance)+ unpause_cdc_extraction_schedule(str(instance.id))+ except Exception as e:+ capture_exception(e, {"source_id": str(instance.id), "team_id": self.team_id})+ return Response(+ status=status.HTTP_400_BAD_REQUEST,+ data={"message": f"Could not resume CDC: {e}"},+ )++ return Response(status=status.HTTP_200_OK, data={"success": True})+@action(methods=["POST"], detail=True)def update_cdc_settings(self, request: Request, *arg: Any, **kwargs: Any):"""Update CDC tuning fields without enabling/disabling.@@ -4097,6 +4200,15 @@ class ExternalDataSourceViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixidata={"message": f"Could not connect to source to read CDC status: {e}"},)+ # Paused-but-slot-intact means a non-retryable failure stopped the schedule; the UI offers+ # Resume (vs Repair) so the user can restart without a full re-sync. Best-effort: a Temporal+ # hiccup must not 500 this otherwise DB-only status read, so degrade to not-paused.+ try:+ schedule_paused = is_cdc_extraction_schedule_paused(str(instance.id))+ except Exception:+ logger.warning("cdc_status_schedule_paused_lookup_failed", source_id=str(instance.id), exc_info=True)+ schedule_paused = False+return Response(status=status.HTTP_200_OK,data={@@ -4106,6 +4218,7 @@ class ExternalDataSourceViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixi"publication_name": cdc_config.publication_name,"lag_warning_threshold_mb": cdc_config.lag_warning_threshold_mb,"lag_critical_threshold_mb": cdc_config.lag_critical_threshold_mb,+ "schedule_paused": schedule_paused,**live_status,},)diff --git a/products/data_warehouse/backend/tests/api/test_external_data_source.py b/products/data_warehouse/backend/tests/api/test_external_data_source.pyindex 1aca2e91687b..c95f327f4e67 100644--- a/products/data_warehouse/backend/tests/api/test_external_data_source.py+++ b/products/data_warehouse/backend/tests/api/test_external_data_source.py@@ -10854,11 +10854,15 @@ class TestCDCStatus(APIBaseTest):assert response.status_code == 200, response.contentassert response.json() == {"enabled": False}+ @patch(+ "products.data_warehouse.backend.presentation.views.external_data_source.is_cdc_extraction_schedule_paused",+ return_value=False,+ )@patch("products.warehouse_sources.backend.temporal.data_imports.sources.postgres.cdc.adapter.PostgresCDCAdapter.get_status",return_value={"slot_exists": True, "publication_exists": True, "lag_bytes": 2048},)- def test_returns_live_status_when_enabled(self, mock_get_status) -> None:+ def test_returns_live_status_when_enabled(self, mock_get_status, _mock_paused) -> None:source = _make_postgres_source(self.team.pk, self.user, cdc_enabled=True)response = self.client.get(f"/api/environments/{self.team.pk}/external_data_sources/{source.pk}/cdc_status/")assert response.status_code == 200, response.content@@ -10870,14 +10874,48 @@ class TestCDCStatus(APIBaseTest):assert body["slot_exists"] is Trueassert body["publication_exists"] is Trueassert body["lag_bytes"] == 2048+ assert body["schedule_paused"] is False# Read against the stored source model, not a client payload.assert mock_get_status.call_args.args[0].pk == source.pk+ @patch(+ "products.data_warehouse.backend.presentation.views.external_data_source.is_cdc_extraction_schedule_paused",+ return_value=True,+ )+ @patch(+ "products.warehouse_sources.backend.temporal.data_imports.sources.postgres.cdc.adapter.PostgresCDCAdapter.get_status",+ return_value={"slot_exists": True, "publication_exists": True, "lag_bytes": 2048},+ )+ def test_surfaces_schedule_paused(self, _mock_get_status, _mock_paused) -> None:+ source = _make_postgres_source(self.team.pk, self.user, cdc_enabled=True)+ response = self.client.get(f"/api/environments/{self.team.pk}/external_data_sources/{source.pk}/cdc_status/")+ assert response.status_code == 200, response.content+ assert response.json()["schedule_paused"] is True++ @patch(+ "products.data_warehouse.backend.presentation.views.external_data_source.is_cdc_extraction_schedule_paused",+ side_effect=Exception("temporal unavailable"),+ )+ @patch(+ "products.warehouse_sources.backend.temporal.data_imports.sources.postgres.cdc.adapter.PostgresCDCAdapter.get_status",+ return_value={"slot_exists": True, "publication_exists": True, "lag_bytes": 2048},+ )+ def test_schedule_paused_lookup_failure_degrades_to_false(self, _mock_get_status, _mock_paused) -> None:+ # A Temporal outage must not 500 this otherwise DB-only status read.+ source = _make_postgres_source(self.team.pk, self.user, cdc_enabled=True)+ response = self.client.get(f"/api/environments/{self.team.pk}/external_data_sources/{source.pk}/cdc_status/")+ assert response.status_code == 200, response.content+ assert response.json()["schedule_paused"] is False++ @patch(+ "products.data_warehouse.backend.presentation.views.external_data_source.is_cdc_extraction_schedule_paused",+ return_value=False,+ )@patch("products.warehouse_sources.backend.temporal.data_imports.sources.postgres.cdc.adapter.PostgresCDCAdapter.get_status",return_value={"slot_exists": False, "publication_exists": True, "lag_bytes": None},)- def test_surfaces_missing_slot(self, _mock_get_status) -> None:+ def test_surfaces_missing_slot(self, _mock_get_status, _mock_paused) -> None:source = _make_postgres_source(self.team.pk, self.user, cdc_enabled=True)response = self.client.get(f"/api/environments/{self.team.pk}/external_data_sources/{source.pk}/cdc_status/")assert response.status_code == 200, response.content@@ -10896,6 +10934,105 @@ class TestCDCStatus(APIBaseTest):assert "Could not connect to source" in response.json()["message"]+class TestResumeCDC(APIBaseTest):+ def _resume(self, source: ExternalDataSource):+ return self.client.post(+ f"/api/environments/{self.team.pk}/external_data_sources/{source.pk}/resume_cdc/",+ )++ def _cdc_schema(self, source: ExternalDataSource, *, broken: bool = False) -> ExternalDataSchema:+ config: dict[str, t.Any] = {"cdc_mode": "streaming"}+ if broken:+ config["cdc_broken"] = BROKEN_MARKER+ return ExternalDataSchema.objects.create(+ name="orders",+ team_id=self.team.pk,+ source_id=source.pk,+ sync_type=ExternalDataSchema.SyncType.CDC,+ should_sync=True,+ status=ExternalDataSchema.Status.FAILED,+ sync_type_config=config,+ )++ def test_resume_cdc_rejects_when_cdc_not_enabled(self) -> None:+ source = _make_postgres_source(self.team.pk, self.user)+ response = self._resume(source)+ assert response.status_code == 400+ assert "CDC is not enabled" in response.json()["message"]++ def test_resume_cdc_rejects_when_no_cdc_schemas(self) -> None:+ # CDC enabled but nothing syncs via CDC — resuming would report success while nothing runs.+ source = _make_postgres_source(self.team.pk, self.user, cdc_enabled=True)+ response = self._resume(source)+ assert response.status_code == 400+ assert "nothing to resume" in response.json()["message"]++ @patch("products.data_warehouse.backend.presentation.views.external_data_source.sync_cdc_extraction_schedule")+ @patch("products.data_warehouse.backend.presentation.views.external_data_source.unpause_cdc_extraction_schedule")+ @patch(+ "products.warehouse_sources.backend.temporal.data_imports.sources.postgres.cdc.adapter.PostgresCDCAdapter.get_status",+ return_value={"slot_exists": True, "publication_exists": True, "lag_bytes": 128},+ )+ def test_resume_cdc_unpauses_when_slot_intact(self, mock_get_status, mock_unpause, mock_sync) -> None:+ source = _make_postgres_source(self.team.pk, self.user, cdc_enabled=True)+ self._cdc_schema(source)++ response = self._resume(source)+ assert response.status_code == 200, response.content+ assert response.json()["success"] is True+ # Recreate-if-missing then unpause, so a schedule deleted out-of-band can't report false success.+ mock_sync.assert_called_once()+ assert mock_sync.call_args.args[0].pk == source.pk+ mock_unpause.assert_called_once_with(str(source.pk))+ assert mock_get_status.call_args.args[0].pk == source.pk++ @patch("products.data_warehouse.backend.presentation.views.external_data_source.unpause_cdc_extraction_schedule")+ @patch(+ "products.warehouse_sources.backend.temporal.data_imports.sources.postgres.cdc.adapter.PostgresCDCAdapter.get_status"+ )+ def test_resume_cdc_rejected_when_broken_marker(self, mock_get_status, mock_unpause) -> None:+ # A lost slot/publication is marked cdc_broken — resume must route to Repair, not unpause+ # (and must not even probe, since the source is known-broken).+ source = _make_postgres_source(self.team.pk, self.user, cdc_enabled=True)+ self._cdc_schema(source, broken=True)++ response = self._resume(source)+ assert response.status_code == 400+ assert "Repair CDC" in response.json()["message"]+ mock_unpause.assert_not_called()+ mock_get_status.assert_not_called()++ @patch("products.data_warehouse.backend.presentation.views.external_data_source.unpause_cdc_extraction_schedule")+ @patch(+ "products.warehouse_sources.backend.temporal.data_imports.sources.postgres.cdc.adapter.PostgresCDCAdapter.get_status",+ side_effect=psycopg.OperationalError("password authentication failed"),+ )+ def test_resume_cdc_rejected_when_connection_still_fails(self, _mock_get_status, mock_unpause) -> None:+ # The whole point: don't unpause straight back into the same deterministic auth failure.+ source = _make_postgres_source(self.team.pk, self.user, cdc_enabled=True)+ self._cdc_schema(source)++ response = self._resume(source)+ assert response.status_code == 400+ assert "check the credentials" in response.json()["message"]+ mock_unpause.assert_not_called()++ @patch("products.data_warehouse.backend.presentation.views.external_data_source.unpause_cdc_extraction_schedule")+ @patch(+ "products.warehouse_sources.backend.temporal.data_imports.sources.postgres.cdc.adapter.PostgresCDCAdapter.get_status",+ return_value={"slot_exists": False, "publication_exists": True, "lag_bytes": None},+ )+ def test_resume_cdc_rejected_when_slot_missing_without_marker(self, _mock_get_status, mock_unpause) -> None:+ # Slot dropped on the source DB before any run set cdc_broken: the live probe still catches it.+ source = _make_postgres_source(self.team.pk, self.user, cdc_enabled=True)+ self._cdc_schema(source)++ response = self._resume(source)+ assert response.status_code == 400+ assert "Repair CDC" in response.json()["message"]+ mock_unpause.assert_not_called()++class TestExternalDataSourceConnectLink(APIBaseTest):def _connect_link(self, source_type: str):return self.client.get(diff --git a/products/data_warehouse/frontend/scenes/SourceScene/tabs/CDCSection.tsx b/products/data_warehouse/frontend/scenes/SourceScene/tabs/CDCSection.tsxindex 3f3afd100df2..f986f1d9dba4 100644--- a/products/data_warehouse/frontend/scenes/SourceScene/tabs/CDCSection.tsx+++ b/products/data_warehouse/frontend/scenes/SourceScene/tabs/CDCSection.tsx@@ -27,7 +27,10 @@ import { humanizeBytes } from 'lib/utils/numbers'import { AccessControlLevel, AccessControlResourceType, ExternalDataSource } from '~/types'-import { externalDataSourcesRepairCdcCreate } from 'products/warehouse_sources/frontend/generated/api'+import {+ externalDataSourcesRepairCdcCreate,+ externalDataSourcesResumeCdcCreate,+} from 'products/warehouse_sources/frontend/generated/api'import { CDC_SOURCE_TYPES } from '../../../shared/cdc'import { sourceSettingsLogic } from './sourceSettingsLogic'@@ -260,6 +263,32 @@ function EnabledControls({ source }: { source: ExternalDataSource }): JSX.Elemen})}+ const onResume = (): void => {+ confirmThen({+ title: 'Resume CDC',+ description: (+ <p className="m-0">+ CDC extraction was paused after a failure. If you've fixed the cause (for example, corrected the+ database credentials), resuming picks up streaming from where it left off — no re-sync.+ </p>+ ),+ primaryText: 'Resume',+ onConfirm: async () => {+ setBusy(true)+ try {+ await externalDataSourcesResumeCdcCreate(String(ApiConfig.getCurrentTeamId()), source.id)+ lemonToast.success('CDC resumed')+ loadSource()+ loadCdcStatus()+ } catch (e: any) {+ lemonToast.error(e?.message ?? "Couldn't resume CDC")+ } finally {+ setBusy(false)+ }+ },+ })+ }+const onDisable = (): void => {confirmThen({title: 'Disable CDC',@@ -382,6 +411,26 @@ function EnabledControls({ source }: { source: ExternalDataSource }): JSX.Elemen</div></LemonBanner>)}+ {status?.schedule_paused && status.slot_exists && status.publication_exists && (+ <LemonBanner type="warning" className="mt-2">+ <div className="space-y-2">+ <p className="m-0">+ CDC extraction is paused after a non-retryable failure (often bad credentials). The+ replication slot is still intact, so once you've fixed the cause you can resume without+ a re-sync.+ </p>+ <AccessControlAction+ resourceType={AccessControlResourceType.ExternalDataSource}+ minAccessLevel={AccessControlLevel.Editor}+ userAccessLevel={source.user_access_level}+ >+ <LemonButton type="secondary" size="small" onClick={onResume} loading={busy}>+ Resume CDC+ </LemonButton>+ </AccessControlAction>+ </div>+ </LemonBanner>+ )}{status?.publication_exists && (<div className="mt-3"><div className="text-secondary text-xs mb-1">diff --git a/products/data_warehouse/frontend/scenes/SourceScene/tabs/sourceSettingsLogic.ts b/products/data_warehouse/frontend/scenes/SourceScene/tabs/sourceSettingsLogic.tsindex 48ba09d2108e..2ed53e5ac24b 100644--- a/products/data_warehouse/frontend/scenes/SourceScene/tabs/sourceSettingsLogic.ts+++ b/products/data_warehouse/frontend/scenes/SourceScene/tabs/sourceSettingsLogic.ts@@ -60,6 +60,7 @@ export interface CdcStatus {publication_exists?: booleanlag_bytes?: number | nullpublished_tables?: string[]+ schedule_paused?: boolean}const REFRESH_INTERVAL = 5000@@ -462,6 +463,7 @@ export interface sourceSettingsLogicActions {publication_exists?: boolean | undefinedpublication_name?: string | undefinedpublished_tables?: string[] | undefined+ schedule_paused?: boolean | undefinedslot_exists?: boolean | undefinedslot_name?: string | undefined},@@ -476,6 +478,7 @@ export interface sourceSettingsLogicActions {publication_exists?: boolean | undefinedpublication_name?: string | undefinedpublished_tables?: string[] | undefined+ schedule_paused?: boolean | undefinedslot_exists?: boolean | undefinedslot_name?: string | undefined}diff --git a/products/warehouse_sources/frontend/generated/api.schemas.ts b/products/warehouse_sources/frontend/generated/api.schemas.tsindex 7fcb6e21a2a4..257ee7a6fe96 100644--- a/products/warehouse_sources/frontend/generated/api.schemas.ts+++ b/products/warehouse_sources/frontend/generated/api.schemas.ts@@ -7954,6 +7954,10 @@ export type ExternalDataSourcesRepairCdcCreate200 = {schemas_reset?: number}+export type ExternalDataSourcesResumeCdcCreate200 = {+ success?: boolean+}+export type ExternalDataSourcesCheckCdcPrerequisitesCreate200 = {valid?: booleanerrors?: string[]diff --git a/products/warehouse_sources/frontend/generated/api.ts b/products/warehouse_sources/frontend/generated/api.tsindex 1828430a4868..398f5a732672 100644--- a/products/warehouse_sources/frontend/generated/api.ts+++ b/products/warehouse_sources/frontend/generated/api.ts@@ -25,6 +25,7 @@ import type {ExternalDataSourcesListParams,ExternalDataSourcesOauthAccountsRetrieveParams,ExternalDataSourcesRepairCdcCreate200,+ ExternalDataSourcesResumeCdcCreate200,ExternalDataSourcesStoredCredentialsListParams,ExternalDataSourcesWizardRetrieveParams,IntegrationAccountsResponseApi,@@ -679,6 +680,32 @@ export const externalDataSourcesRepairCdcCreate = async (})}+export const getExternalDataSourcesResumeCdcCreateUrl = (projectId: string, id: string) => {+ return `/api/projects/${projectId}/external_data_sources/${id}/resume_cdc/`+}++/**+ * Resume a CDC source whose extraction schedule was paused by a non-retryable+ * failure that left the replication slot intact (bad credentials, SSL/host errors).+ *+ * Once the user has fixed the root cause, this re-probes the source DB — confirming+ * the connection now succeeds and the slot/publication still exist — then unpauses the+ * extraction schedule so streaming resumes from where it left off. No re-snapshot, so+ * it's the cheap counterpart to Repair CDC. If the slot/publication are actually gone+ * (``cdc_broken``, or a live probe showing them missing), resume is refused — only+ * Repair CDC can recreate them, at the cost of a full re-sync.+ */+export const externalDataSourcesResumeCdcCreate = async (+ projectId: string,+ id: string,+ options?: RequestInit+): Promise<ExternalDataSourcesResumeCdcCreate200> => {+ return apiMutator<ExternalDataSourcesResumeCdcCreate200>(getExternalDataSourcesResumeCdcCreateUrl(projectId, id), {+ ...options,+ method: 'POST',+ })+}+export const getExternalDataSourcesRevenueAnalyticsConfigPartialUpdateUrl = (projectId: string, id: string) => {return `/api/projects/${projectId}/external_data_sources/${id}/revenue_analytics_config/`}diff --git a/products/warehouse_sources/mcp/tools.yaml b/products/warehouse_sources/mcp/tools.yamlindex 7e64746d291f..4710a9f88de2 100644--- a/products/warehouse_sources/mcp/tools.yaml+++ b/products/warehouse_sources/mcp/tools.yaml@@ -459,6 +459,9 @@ tools:gone cannot be recovered), and resumes the paused sync schedules. Refuses with a 400 if CDC looks healthy(both slot and publication exist) so it cannot accidentally force a re-sync, and with a 409 if a repair isalready running. Safe to retry after a failure. Returns {success, schemas_reset}.+ external-data-sources-resume-cdc-create:+ operation: external_data_sources_resume_cdc_create+ enabled: falseexternal-data-sources-retrieve:operation: external_data_sources_retrieveenabled: truediff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex b144beac85d5..2f22fdc6fb78 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -66770,6 +66770,10 @@ export namespace Schemas {schemas_reset?: number;};+ export type EnvironmentsExternalDataSourcesResumeCdcCreate200 = {+ success?: boolean;+ };+export type EnvironmentsExternalDataSourcesCheckCdcPrerequisitesCreate200 = {valid?: boolean;errors?: string[];@@ -74181,6 +74185,10 @@ export namespace Schemas {schemas_reset?: number;};+ export type ExternalDataSourcesResumeCdcCreate200 = {+ success?: boolean;+ };+export type ExternalDataSourcesCheckCdcPrerequisitesCreate200 = {valid?: boolean;errors?: string[];