hailin0 commented on code in PR #6785:
URL: https://github.com/apache/seatunnel/pull/6785#discussion_r1585022938


##########
seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/postgres/source/reader/PostgresSourceFetchTaskContext.java:
##########
@@ -180,28 +179,31 @@ public void configure(SourceSplitBase sourceSplitBase) {
                 snapshotter.init(connectorConfig, 
offsetContext.asOffsetState(), slotInfo);
             }
 
-            SlotCreationResult slotCreatedInfo = null;
             if (snapshotter.shouldStream()) {
-                final boolean doSnapshot = snapshotter.shouldSnapshot();
-                createReplicationConnection(
-                        doSnapshot, connectorConfig.maxRetries(), 
connectorConfig.retryDelay());
                 // we need to create the slot before we start streaming if it 
doesn't exist
                 // otherwise we can't stream back changes happening while the 
snapshot is taking
                 // place
-                if (slotInfo == null) {
+                if (this.replicationConnection == null) {
+                    this.replicationConnection =
+                            createReplicationConnection(
+                                    this.taskContext,
+                                    snapshotter.shouldSnapshot(),
+                                    connectorConfig.maxRetries(),
+                                    connectorConfig.retryDelay());
                     try {
-                        slotCreatedInfo =
-                                
replicationConnection.createReplicationSlot().orElse(null);
+                        // create the slot if it doesn't exist, otherwise 
update slot to add new
+                        // table(job restore and add table)

Review Comment:
   cc @Carl-Zhou-CN 



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

Reply via email to