mirror of
https://github.com/dadosfera/maestro.git
synced 2026-10-21 14:19:08 +00:00
FIX: CDC table removal reconfigures the Debezium connector
deleteTable called the DB-row-only DELETE /jobs/{id}, leaving the CDC
connector still replicating a removed table. For CDC jobs, call
DELETE /pipeline/{id}/jobs (RemoveJobsUsecase) with delete_snowflake_tables
false so replication stops but landed data is kept. Batch path unchanged.
Co-Authored-By: WOZCODE <contact@withwoz.com>
This commit is contained in:
@@ -964,7 +964,18 @@ export class PlatformApiController {
|
||||
if (!job) throw new NotFoundException(`Job for table '${tableName}' not found in pipeline`);
|
||||
|
||||
this.logger.info('deleteTable: deleting job from platform-api', { jobId: job.job_id });
|
||||
await this.platformApiService.proxy('DELETE', `/jobs/${job.job_id}`, user);
|
||||
if (job.input?.connector === 'cdc') {
|
||||
// CDC: reconfigure the Debezium/Kafka-Connect connector (stop
|
||||
// replicating this table); keep the landed Snowflake data.
|
||||
await this.platformApiService.proxy(
|
||||
'DELETE',
|
||||
`/pipeline/${normalizedPipelineId}/jobs`,
|
||||
user,
|
||||
{ job_ids: [job.job_id], delete_snowflake_tables: false },
|
||||
);
|
||||
} else {
|
||||
await this.platformApiService.proxy('DELETE', `/jobs/${job.job_id}`, user);
|
||||
}
|
||||
this.logger.info('deleteTable: job deleted', { jobId: job.job_id });
|
||||
|
||||
return { name: tableName, is_deleted: updatedInput.is_deleted ?? true, deleted_at: updatedInput.deleted_at };
|
||||
|
||||
Reference in New Issue
Block a user