Skip to content

[Source-MySQL] Correctly set Debezium MySQL connector database timezone property - #30333

Merged
Octavia The Approver (octavia-approvington) merged 8 commits into
masterfrom
mysql-cdc-invalid-timezone
Sep 14, 2023
Merged

Octavia The Approver (octavia-approvington) merged 8 commits into
masterfrom
mysql-cdc-invalid-timezone

Conversation

@nguyenaiden

@nguyenaiden Duy Nguyen (nguyenaiden) commented Sep 12, 2023 •

Copy link
Copy Markdown
Contributor

What

#24659

I was able to reproduce it via running a local MySQL instance inside a Docker container with the specifically problematic CEST timezone and ran a sync on OSS.

How

The database timezone parameter was incorrectly set to database.serverTimezone, but per Debezium docs, the correct property is database.connectionTimezone.

@github-actions

github-actions Bot commented Sep 12, 2023 •

Copy link
Copy Markdown
Contributor

Before Merging a Connector Pull Request

Wow! What a great pull request you have here! 🎉

To merge this PR, ensure the following has been done/considered for each connector added or updated:

  • PR name follows PR naming conventions
  • Breaking changes are considered. If a Breaking Change is being introduced, ensure an Airbyte engineer has created a Breaking Change Plan.
  • Connector version has been incremented in the Dockerfile and metadata.yaml according to our Semantic Versioning for Connectors guidelines
  • You've updated the connector's metadata.yaml file any other relevant changes, including a breakingChanges entry for major version bumps. See metadata.yaml docs
  • Secrets in the connector's spec are annotated with airbyte_secret
  • All documentation files are up to date. (README.md, bootstrap.md, docs.md, etc...)
  • Changelog updated in docs/integrations/<source or destination>/<name>.md with an entry for the new version. See changelog example
  • Migration guide updated in docs/integrations/<source or destination>/<name>-migrations.md with an entry for the new version, if the version is a breaking change. See migration guide example
  • If set, you've ensured the icon is present in the platform-internal repo. (Docs)

If the checklist is complete, but the CI check is failing,

  1. Check for hidden checklists in your PR description

  2. Toggle the github label checklist-action-run on/off to re-run the checklist CI.

@github-actions

Copy link
Copy Markdown
Contributor

source-mysql test report (commit ff440b155c) - ❌

⏲️ Total pipeline duration: 322mn09s

Step Result
Java Connector Unit Tests ✅
Build connector tar ✅
Build source-mysql docker image for platform linux/x86_64 ✅
Java Connector Integration Tests ❌
Acceptance tests ✅
Validate airbyte-integrations/connectors/source-mysql/metadata.yaml ✅
Connector version semver check ✅
Connector version increment check ❌
QA checks ✅

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-mysql test

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting! I bet when we added that property it was called serverTimezone but they changed it in one of the upgrades! Can you add a test for this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a link to the exact section in Debezium docs where this property is listed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://debezium.io/documentation/reference/stable/connectors/mysql.html
The time zone will be queried from the server by default. If this fails, it must be specified explicitly by the database connectionTimeZone MySQL configuration option. For example, if the database’s time zone (either globally or configured for the connector by means of the connectionTimeZone option) is "America/Los_Angeles", the TIMESTAMP value "2018-06-20 06:37:03" is represented by a ZonedTimestamp with the value "2018-06-20T13:37:03Z".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this fails
Do we know for a fact there was a failure?

Is the failure here because the server timezone is not IANA compliant?
That is CEST rather than Europe/Berlin

@github-actions

Copy link
Copy Markdown
Contributor

source-mysql-strict-encrypt test report (commit b90bd686bd) - ❌

⏲️ Total pipeline duration: 43mn19s

Step Result
Java Connector Unit Tests ❌
Build connector tar ✅
Build source-mysql-strict-encrypt docker image for platform linux/x86_64 ✅
Java Connector Integration Tests ❌
Acceptance tests ❌
Validate airbyte-integrations/connectors/source-mysql-strict-encrypt/metadata.yaml ✅
Connector version semver check ✅
QA checks ❌

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-mysql-strict-encrypt test

@github-actions

Copy link
Copy Markdown
Contributor

source-mysql test report (commit b90bd686bd) - ❌

⏲️ Total pipeline duration: 319mn25s

Step Result
Java Connector Unit Tests ✅
Build connector tar ✅
Build source-mysql docker image for platform linux/x86_64 ✅
Java Connector Integration Tests ❌
Acceptance tests ✅
Validate airbyte-integrations/connectors/source-mysql/metadata.yaml ✅
Connector version semver check ✅
Connector version increment check ✅
QA checks ❌

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-mysql test

@github-actions

Copy link
Copy Markdown
Contributor

source-mysql-strict-encrypt test report (commit b9c1649a9d) - ❌

⏲️ Total pipeline duration: 43mn02s

Step Result
Java Connector Unit Tests ❌
Build connector tar ✅
Build source-mysql-strict-encrypt docker image for platform linux/x86_64 ✅
Java Connector Integration Tests ❌
Acceptance tests ❌
Validate airbyte-integrations/connectors/source-mysql-strict-encrypt/metadata.yaml ✅
Connector version semver check ✅
QA checks ❌

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-mysql-strict-encrypt test

@github-actions

Copy link
Copy Markdown
Contributor

source-mysql test report (commit b9c1649a9d) - ❌

⏲️ Total pipeline duration: 319mn41s

Step Result
Java Connector Unit Tests ✅
Build connector tar ✅
Build source-mysql docker image for platform linux/x86_64 ✅
Java Connector Integration Tests ❌
Acceptance tests ✅
Validate airbyte-integrations/connectors/source-mysql/metadata.yaml ✅
Connector version semver check ✅
Connector version increment check ✅
QA checks ❌

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-mysql test

@github-actions

Copy link
Copy Markdown
Contributor

source-mysql test report (commit c93a123e52) - ❌

⏲️ Total pipeline duration: 321mn42s

Step Result
Java Connector Unit Tests ✅
Build connector tar ✅
Build source-mysql docker image for platform linux/x86_64 ✅
Java Connector Integration Tests ❌
Acceptance tests ✅
Validate airbyte-integrations/connectors/source-mysql/metadata.yaml ✅
Connector version semver check ✅
Connector version increment check ✅
QA checks ❌

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-mysql test

@github-actions

Copy link
Copy Markdown
Contributor

source-mysql-strict-encrypt test report (commit c93a123e52) - ❌

⏲️ Total pipeline duration: 40mn02s

Step Result
Java Connector Unit Tests ❌
Build connector tar ✅
Build source-mysql-strict-encrypt docker image for platform linux/x86_64 ✅
Java Connector Integration Tests ❌
Acceptance tests ❌
Validate airbyte-integrations/connectors/source-mysql-strict-encrypt/metadata.yaml ✅
Connector version semver check ✅
QA checks ❌

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-mysql-strict-encrypt test

@prateekmukhedkar

Copy link
Copy Markdown
Contributor

I applied these changes and was able to sync a MariaDB hosted MySQL database in CDC mode, which was failing with this error otherwise.
Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'unknown' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the 'connectionTimeZone' configuration property) to use a more specific time zone value if you want to utilize time zone support.

# Conflicts:
#	airbyte-integrations/connectors/source-mysql-strict-encrypt/metadata.yaml
#	airbyte-integrations/connectors/source-mysql/metadata.yaml
#	airbyte-integrations/connectors/source-mysql/src/test/java/io/airbyte/integrations/source/mysql/CdcMysqlSourceTest.java
#	docs/integrations/sources/mysql.md

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed a commit to bring in the latest changes from master and resolve conflicts + add more assertions to the test (around the sync completing and asserting data).

Please run all the tests locally before merging as CI is broken.

@github-actions

Copy link
Copy Markdown
Contributor

source-mysql test report (commit 0eb24255d0) - ❌

⏲️ Total pipeline duration: 321mn45s

Step Result
Build connector tar ✅
Build source-mysql docker image for platform linux/x86_64 ✅
Java Connector Unit Tests ✅
Java Connector Integration Tests ❌
Acceptance tests ✅
Validate airbyte-integrations/connectors/source-mysql/metadata.yaml ✅
Connector version semver check ✅
Connector version increment check ✅
QA checks ✅

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-mysql test

@github-actions

Copy link
Copy Markdown
Contributor

source-mysql-strict-encrypt test report (commit 0eb24255d0) - ❌

⏲️ Total pipeline duration: 36mn35s

Step Result
Build connector tar ✅
Build source-mysql-strict-encrypt docker image for platform linux/x86_64 ✅
Java Connector Unit Tests ❌
Java Connector Integration Tests ❌
Acceptance tests ❌
Validate airbyte-integrations/connectors/source-mysql-strict-encrypt/metadata.yaml ✅
Connector version semver check ✅
Connector version increment check ✅
QA checks ❌

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-mysql-strict-encrypt test

@nguyenaiden

Copy link
Copy Markdown
Contributor Author

/approve-and-merge reason="CI is down and all expected tests passed locally"

@octavia-approvington

Copy link
Copy Markdown
Contributor

Enough! Let's do this
goooooo!

@github-actions

Copy link
Copy Markdown
Contributor

source-mysql test report (commit 8400b75bac) - ❌

⏲️ Total pipeline duration: 321mn44s

Step Result
Build connector tar ✅
Build source-mysql docker image for platform linux/x86_64 ✅
Java Connector Unit Tests ✅
Java Connector Integration Tests ❌
Acceptance tests ✅
Validate airbyte-integrations/connectors/source-mysql/metadata.yaml ✅
Connector version semver check ✅
Connector version increment check ✅
QA checks ✅

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-mysql test

@github-actions

Copy link
Copy Markdown
Contributor

source-mysql-strict-encrypt test report (commit 8400b75bac) - ❌

⏲️ Total pipeline duration: 36mn37s

Step Result
Build connector tar ✅
Build source-mysql-strict-encrypt docker image for platform linux/x86_64 ✅
Java Connector Unit Tests ❌
Java Connector Integration Tests ❌
Acceptance tests ❌
Validate airbyte-integrations/connectors/source-mysql-strict-encrypt/metadata.yaml ✅
Connector version semver check ✅
Connector version increment check ❌
QA checks ❌

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-mysql-strict-encrypt test

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.

6 participants