Repository navigation
[cherry-pick][0.10] Translate Debezium 1.x config keys and keep MySQL SSL disabled - #315
Open
sahusanket wants to merge 2 commits into
Open
sahusanket wants to merge 2 commits into
sahusanket wants to merge 2 commits into
Conversation
Debezium 2.x removed the *.whitelist and *.blacklist aliases and renamed database.history.* to schema.history.internal.*. The readers only mapped some of the old keys that users pass as source.connector.* runtime arguments: column.blacklist was dropped by both readers, MySQL ignored column.whitelist, and SQL Server mapped database.history.store.only.monitored.tables.ddl to a key that does not exist in Debezium 2.x. A pipeline that used column.blacklist to keep columns out of the target now replicated them. Add DebeziumLegacyConfigs in delta-plugins-common with one translation table used by both readers: column.whitelist, column.blacklist and the store.only.monitored.tables.ddl key map to their 2.x names, and other database.history.* keys keep the generic prefix rename. When both the old and the new key are given, the new key wins. table.whitelist keeps its Debezium 1.x behavior per connector: SQL Server still maps it to table.include.list (the reader used to set table.whitelist, so a user value replaced it), and MySQL still ignores it (the reader set table.include.list, which took precedence). table.blacklist and database.server.name are intentionally not mapped. Move the Debezium config building in both readers into createDebeziumConfig() so it can be unit tested. (cherry picked from commit 33f5203)
Debezium 2.x changed the default of database.ssl.mode from disabled to preferred. With preferred, the connector tries TLS whenever the server offers it, so MySQL servers that only offer TLS versions the Java 11 runtime rejects now fail at connect time. 6.11.1 used Debezium 1.9.7, which did not use SSL unless asked to. Set database.ssl.mode=disabled before the user overrides are applied so the patch release keeps the 6.11.1 behavior. Users can still enable SSL with the source.connector.database.ssl.mode runtime argument.
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.
Cherry-pick of #313 onto
release/0.10.Cherry-pick of the develop fix (fix/debezium-legacy-config-keys) to release/0.10 for CDF 6.11.2, plus a release/0.10 only commit that keeps MySQL SSL disabled by default.
What was wrong
Debezium 2.x removed the
*.whitelist/*.blacklistaliases and renameddatabase.history.*toschema.history.internal.*. Users pass connector settings assource.connector.*runtime arguments, and the readers only translated some of the old keys after the 2.3.7 upgrade:column.blacklistwas dropped by both readers. A pipeline that used it to keep PII columns out of the target started replicating them.column.whitelist, which SQL Server already translated.database.history.store.only.monitored.tables.ddlintoschema.history.internal.store.only.monitored.tables.ddl, which is not a Debezium 2.x setting, so the setting silently stayed at its default.The upgrade also changed the MySQL
database.ssl.modedefault fromdisabled(Debezium 1.9.7, 6.11.1) topreferred. MySQL servers that only offer TLS versions the Java 11 runtime rejects (for example old TLSv1.0/1.1 only builds) now fail at connect time unless the user setssource.connector.database.ssl.mode=disabled.What this change does
DebeziumLegacyConfigsindelta-plugins-common, used by both readers. It mapscolumn.whitelist,column.blacklistanddatabase.history.store.only.monitored.tables.ddltocolumn.include.list,column.exclude.listandschema.history.internal.store.only.captured.tables.ddl, and keeps the genericdatabase.history.Xtoschema.history.internal.Xrename. If both the old and the new key are given, the new key wins.table.whitelistkeeps its Debezium 1.9.7 behavior per connector. SQL Server still maps it totable.include.list: the reader used to settable.whitelistitself, so a user value replaced the table list. MySQL still ignores it: the reader settable.include.list, which took precedence. Mapping it for MySQL would have changed 6.11.1 behavior, so the MySQL test asserts the table list is unchanged.table.blacklistanddatabase.server.nameare intentionally not mapped (CDAP always setstable.include.list; the offset stores depend on the fixed topic prefix, see BUG-14).createDebeziumConfig()so it can be unit tested.database.ssl.mode=disabledin the MySQL base config before user overrides, so 6.11.2 keeps the 6.11.1 behavior. Users can still opt in withsource.connector.database.ssl.mode. develop keeps the Debezium 2.xpreferreddefault.Commits
git cherry-pick -xof 33f5203 from the develop PR, applied cleanly)Testing
Same new tests as the develop PR (
DebeziumLegacyConfigsTest7,MySqlEventReaderTest6,SqlServerEventReaderTest6), plus two MySQL tests for SSL:testSslIsDisabledByDefaultassertsnew MySqlConnectorConfig(conf).sslMode() == DISABLEDwith no override, andtestSslModeCanBeOverriddenassertsPREFERREDwhendatabase.ssl.mode=preferredis passed.Unit tests do not run in the default build because
${testSourceLocation}is only defined in thee2e-testsprofile (MB-25-BUG-2, not fixed here), so the runs pass-DtestSourceLocation=src/test/java. JDK 11 (Amazon Corretto 11.0.33), Maven through Corp Airlock.Result: BUILD SUCCESS at 0.10.1-SNAPSHOT. delta-plugins-common 10 tests, mysql-delta-plugins 8, sqlserver-delta-plugins 13, 0 failures. Checkstyle and RAT pass.
Without the SSL line (removed temporarily):
Result: Tests run: 8, Failures: 1,
testSslIsDisabledByDefault: expected:<DISABLED> but was:<PREFERRED>.The key translation tests were shown to fail without the translation on develop (failures in MySqlEventReaderTest and SqlServerEventReaderTest); the reader files are identical on release/0.10 before the SSL commit.
Not done here: live pipelines with
source.connector.column.blacklist, and a MySQL 5.7 server withtls_version=TLSv1.1connecting with no SSL override.Regression sheet: BUG-13, MB-26-BUG-2.