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


##########
fs_brokers/cdc_client/src/main/java/org/apache/doris/cdcclient/source/reader/postgres/PostgresSourceReader.java:
##########
@@ -98,6 +103,11 @@ public PostgresSourceReader() {
     public void initialize(String jobId, DataSource dataSource, Map<String, 
String> config) {
         PostgresSourceConfig sourceConfig = generatePostgresConfig(config, 
jobId, 0);
         PostgresDialect dialect = new PostgresDialect(sourceConfig);
+        // Doris-owned publication: pre-create it covering all include_tables 
(autocreate is
+        // DISABLED).
+        if (isPublicationDorisOwned(config, jobId)) {
+            createPublicationForDorisOwned(dialect, config, jobId);
+        }
         // Only create the slot when Doris owns it (name == default); 
user-provided slots must

Review Comment:
   This still leaves Doris-owned PostgreSQL jobs not multi-BE safe for the 
replication slot. `SLOT_CREATION_LOCK` only serializes threads inside one CDC 
client JVM; with the same job scheduled on two BEs, both readers can enter 
`initialize()`, both observe `getReplicationSlotState(...) == null` in 
`createSlotForGlobalStreamSplit()`, and then both call 
`createReplicationSlot()`. One BE will fail with the duplicate slot error and 
abort reader initialization. This is distinct from the already-raised 
publication race because it is the replication slot path after publication 
setup. Please make slot creation duplicate-tolerant, or use database-level 
serialization/advisory locking around the check-create sequence.



-- 
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