dailai commented on code in PR #6526:
URL: https://github.com/apache/seatunnel/pull/6526#discussion_r1582486872


##########
seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/postgres/source/reader/PostgresSourceFetchTaskContext.java:
##########
@@ -180,28 +180,29 @@ 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());
+                if (sourceSplitBase.isIncrementalSplit() || slotInfo == null) {
+                    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) {
                     try {
-                        slotCreatedInfo =
+                        SlotCreationResult slotCreatedInfo =

Review Comment:
   Please remove useless variable definitions.



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