github-actions[bot] commented on code in PR #64423:
URL: https://github.com/apache/doris/pull/64423#discussion_r3427602362
##########
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);
Review Comment:
`releaseSourceResourcesOrRetry()` only schedules the bounded cleanup retry
when this method returns `false`, but this catch treats a failed Doris-owned
publication drop as success whenever the slot is not owned or the slot drop
succeeds. A reachable case is a job with a user-provided slot and default Doris
publication: `DROP PUBLICATION` fails transiently, `dropSlot` is false, line
697 returns `true`, `/api/close` removes the local context and FE metadata, and
the auto-created publication is left behind with no retry. The same leak
happens when both resources are owned but the slot drop succeeds after
publication drop failed. Please track publication cleanup success and return
`false` until every Doris-owned source resource is actually gone.
--
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]