xucq07 commented on code in PR #4534:
URL: https://github.com/apache/flink-cdc/pull/4534#discussion_r4033517818
##########
flink-cdc-connect/flink-cdc-source-connectors/flink-cdc-base/src/main/java/org/apache/flink/cdc/connectors/base/source/assigner/splitter/JdbcSourceChunkSplitter.java:
##########
@@ -102,35 +103,43 @@ public JdbcSourceChunkSplitter(
@Override
public void open() {
- this.jdbcConnection = dialect.openJdbcConnection(sourceConfig);
+ // The connection is acquired lazily and released once a table is
split, so an assigner
+ // that has nothing to split (e.g. restored after the snapshot phase)
holds no connection.
}
/** Generates all snapshot splits (chunks) for the give table path. */
@Override
public Collection<SnapshotSplit> generateSplits(TableId tableId) throws
Exception {
Review Comment:
Done, thanks for the suggestion.
--
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]