Skip to content

[cherry-pick][0.10] Translate Debezium 1.x config keys and keep MySQL SSL disabled - #315

Open
sahusanket wants to merge 2 commits into
release/0.10from
fix/0.10-debezium-legacy-config-keys
Open

sahusanket wants to merge 2 commits into
release/0.10from
fix/0.10-debezium-legacy-config-keys

Conversation

@sahusanket

Copy link
Copy Markdown
Contributor

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 / *.blacklist aliases and renamed database.history.* to schema.history.internal.*. Users pass connector settings as source.connector.* runtime arguments, and the readers only translated some of the old keys after the 2.3.7 upgrade:

  • column.blacklist was dropped by both readers. A pipeline that used it to keep PII columns out of the target started replicating them.
  • MySQL ignored column.whitelist, which SQL Server already translated.
  • SQL Server turned database.history.store.only.monitored.tables.ddl into schema.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.mode default from disabled (Debezium 1.9.7, 6.11.1) to preferred. 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 sets source.connector.database.ssl.mode=disabled.

What this change does

  • Adds DebeziumLegacyConfigs in delta-plugins-common, used by both readers. It maps column.whitelist, column.blacklist and database.history.store.only.monitored.tables.ddl to column.include.list, column.exclude.list and schema.history.internal.store.only.captured.tables.ddl, and keeps the generic database.history.X to schema.history.internal.X rename. If both the old and the new key are given, the new key wins.
  • table.whitelist keeps its Debezium 1.9.7 behavior per connector. SQL Server still maps it to table.include.list: the reader used to set table.whitelist itself, so a user value replaced the table list. MySQL still ignores it: the reader set table.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.blacklist and database.server.name are intentionally not mapped (CDAP always sets table.include.list; the offset stores depend on the fixed topic prefix, see BUG-14).
  • Moves the Debezium config building in both readers into a package-private createDebeziumConfig() so it can be unit tested.
  • release/0.10 only: sets database.ssl.mode=disabled in the MySQL base config before user overrides, so 6.11.2 keeps the 6.11.1 behavior. Users can still opt in with source.connector.database.ssl.mode. develop keeps the Debezium 2.x preferred default.

Commits

  • 0b52a3a Translate Debezium 1.x connector config keys in both readers (git cherry-pick -x of 33f5203 from the develop PR, applied cleanly)
  • b7af3b7 Keep MySQL SSL disabled by default on release/0.10 (new, release/0.10 only)

Testing

Same new tests as the develop PR (DebeziumLegacyConfigsTest 7, MySqlEventReaderTest 6, SqlServerEventReaderTest 6), plus two MySQL tests for SSL: testSslIsDisabledByDefault asserts new MySqlConnectorConfig(conf).sslMode() == DISABLED with no override, and testSslModeCanBeOverridden asserts PREFERRED when database.ssl.mode=preferred is passed.

Unit tests do not run in the default build because ${testSourceLocation} is only defined in the e2e-tests profile (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.

mvn -B clean test -DtestSourceLocation=src/test/java

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

mvn -B test -pl mysql-delta-plugins -am -DtestSourceLocation=src/test/java -Dtest=MySqlEventReaderTest -DfailIfNoTests=false

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 with tls_version=TLSv1.1 connecting with no SSL override.

Regression sheet: BUG-13, MB-26-BUG-2.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant