[FLINK-39391][cdc-connector] Propagate scan.snapshot.fetch.size to Debezium properties in Oracle, SqlServer, DB2, and Postgres connectors#4359
Open
paulo-t wants to merge 2 commits intoapache:masterfrom
Conversation
added 2 commits
April 2, 2026 17:35
…bezium properties in Oracle, SqlServer, DB2, and Postgres connectors The user-configured scan.snapshot.fetch.size is stored in JdbcSourceConfig.fetchSize but was never written into the Debezium Properties object. The snapshot execution path reads fetchSize from Debezium ConnectorConfig (query.fetch.size for Oracle/SqlServer/DB2, snapshot.fetch.size for Postgres) instead of JdbcSourceConfig, so the user value was silently ignored. For Oracle/SqlServer/DB2 this defaults to 0, which causes the JDBC driver to use its own default (e.g. Oracle defaults to fetchSize=10). On high-latency networks this leads to severe performance degradation (observed ~9x slowdown at 31ms RTT vs 3ms RTT). This commit propagates fetchSize into the corresponding Debezium property before the user-defined debezium properties override, so explicit debezium.query.fetch.size / debezium.snapshot.fetch.size overrides still take precedence. MySQL connector is not affected as it already sets database.fetchSize. Made-with: Cursor
… to Debezium properties Verify that scan.snapshot.fetch.size is correctly propagated to the underlying Debezium query.fetch.size (Oracle/SqlServer/DB2) and snapshot.fetch.size (Postgres) properties, including default value propagation and user-provided debezium property override behavior. Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This closes FLINK-39391.
The user-configured
scan.snapshot.fetch.sizeoption has no effect on the actual JDBCfetchSizeused during the incremental snapshot phase for Oracle, SqlServer, DB2, and Postgres connectors.The value is correctly parsed and stored in
JdbcSourceConfig.fetchSize, but is never written into the DebeziumPropertiesobject that the snapshot execution path actually reads.For Oracle/SqlServer/DB2, the snapshot task calls
connectorConfig.getQueryFetchSize(), which reads Debezium'squery.fetch.size— defaulting to0. This causes the JDBC driver to fall back to its own small default (e.g., Oracle defaults tofetchSize=10). On high-latency networks this results in order-of-magnitude performance degradation: ~440 rows/s instead of ~3,500 rows/s with 4 parallel readers on ~31ms RTT.For Postgres, the snapshot task reads
snapshot.fetch.sizewhich defaults to2000, so the impact is less severe but the user-configured value is still silently ignored.MySQL is NOT affected —
MySqlSourceConfigFactoryalready correctly setsprops.setProperty("database.fetchSize", ...).The fix adds a
props.setProperty()call in each affectedSourceConfigFactory.create()before thedbzProperties.putAll()block, so that explicit user overrides viadebezium.query.fetch.size/debezium.snapshot.fetch.sizestill take precedence.