github-actions[bot] commented on code in PR #64423:
URL: https://github.com/apache/doris/pull/64423#discussion_r3427557864


##########
fs_brokers/cdc_client/src/main/java/org/apache/doris/cdcclient/source/reader/postgres/PostgresSourceReader.java:
##########
@@ -618,29 +682,42 @@ public void close(JobBaseConfig jobConfig) {
                     slotName,
                     pubName,
                     jobId);
-            return;
+            return true;
         }
-        try {
-            PostgresSourceConfig sourceConfig = getSourceConfig(jobConfig);
-            PostgresDialect dialect = new PostgresDialect(sourceConfig);
-            if (dropSlot) {
-                LOG.info("Dropping auto-created replication slot {} for job 
{}", slotName, jobId);
-                dialect.removeSlot(slotName);
-            } else {
-                LOG.info("Skipping drop of user-provided slot {} for job {}", 
slotName, jobId);
-            }
-            if (dropPub) {
-                LOG.info("Dropping auto-created publication {} for job {}", 
pubName, jobId);
-                try (PostgresConnection connection = 
dialect.openJdbcConnection()) {
-                    connection.execute("DROP PUBLICATION IF EXISTS " + 
pubName);
-                }
-            } else {
-                LOG.info(
-                        "Skipping drop of user-provided publication {} for job 
{}", pubName, jobId);
+        PostgresDialect dialect = new 
PostgresDialect(getSourceConfig(jobConfig));
+        if (dropPub) {
+            LOG.info("Dropping auto-created publication {} for job {}", 
pubName, jobId);
+            try (PostgresConnection connection = dialect.openJdbcConnection()) 
{
+                connection.execute("DROP PUBLICATION IF EXISTS " + pubName);
+            } catch (Exception ex) {
+                LOG.warn("Failed to drop publication {} for job {}: {}", 
pubName, jobId, ex.getMessage());

Review Comment:
   This returns success even if the Doris-owned publication drop above failed. 
That is reachable when a user provides `slot_name` but omits `publication_name` 
(FE fills `doris_pub_<jobId>` and the cdc_client creates it), or when both 
resources are Doris-owned and the slot drop succeeds after a transient `DROP 
PUBLICATION` failure. `/api/close` only schedules `pendingSlotDrops` when 
`releaseSourceResources()` returns false or throws, so the publication can be 
left behind on PG after the job metadata is deleted. Please track the 
publication drop result and return false, or otherwise schedule a retry, when a 
Doris-owned publication could not be removed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to