sd4324530 commented on code in PR #4362:
URL: https://github.com/apache/flink-cdc/pull/4362#discussion_r4444074056
##########
flink-cdc-connect/flink-cdc-source-connectors/flink-connector-postgres-cdc/src/main/java/org/apache/flink/cdc/connectors/postgres/table/PostgreSQLTableFactory.java:
##########
@@ -127,6 +128,7 @@ public DynamicTableSource
createDynamicTableSource(DynamicTableFactory.Context c
boolean appendOnly =
config.get(SCAN_READ_CHANGELOG_AS_APPEND_ONLY_ENABLED);
boolean releaseSnapshotMetadataEnabled =
config.get(SCAN_INCREMENTAL_SNAPSHOT_METADATA_RELEASE_ENABLED);
+ double scanRateLimitRecordsPerSecond =
config.get(SCAN_RATE_LIMIT_RECORDS_PER_SECOND);
Review Comment:
Thanks @lvyanquan . Only the incremental source reader applies the rate
limiter; the legacy `SourceFunction` path ignores it, and PostgreSQL selects
that
path by default.
Changes in the latest commit:
- **PostgreSQL (as reported)**: setting `scan.rate-limit.records-per-second`
while
`scan.incremental.snapshot.enabled=false` now fails validation with a clear
message instead of being silently ignored.
- **MongoDB**: same issue — `scan.incremental.snapshot.enabled` also
defaults to
`false`, so the same validation was added.
- **MySQL, Oracle, SQL Server, Db2**: their default configuration is fine,
but the
option can still be combined with
`scan.incremental.snapshot.enabled=false`;
added the same check to keep the behaviour consistent across connectors.
- Documented the requirement in the English/Chinese docs and option
descriptions.
- Added regression tests: `testRateLimitRequiresIncrementalSnapshot` for all
six
connectors, plus `testRateLimitWithIncrementalSnapshot` for PostgreSQL
with a
non-default value (`100`).
- The six factory test suites and `spotless:check` pass.
Please take another look when you have time.
--
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]