Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysql-cdc: implementation to construct initial debezium state #28561

Merged
merged 11 commits into from
Jul 26, 2023

Conversation

subodh1810
Copy link
Contributor

@subodh1810 subodh1810 commented Jul 21, 2023

Issue : #28238

@github-actions
Copy link
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.

@subodh1810 subodh1810 marked this pull request as ready for review July 24, 2023 17:38
@subodh1810 subodh1810 requested a review from a team as a code owner July 24, 2023 17:38
@subodh1810 subodh1810 requested a review from akashkulk July 24, 2023 17:38
@octavia-squidington-iii
Copy link
Collaborator

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

⏲️ Total pipeline duration: 17mn10s

Step Result
Validate airbyte-integrations/connectors/source-mysql-strict-encrypt/metadata.yaml
Connector version semver check
QA checks
Build connector tar
Build source-mysql-strict-encrypt docker image for platform linux/x86_64
./gradlew :airbyte-integrations:connectors:source-mysql-strict-encrypt:integrationTest
Acceptance tests

🔗 View the logs here

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

@octavia-squidington-iii
Copy link
Collaborator

source-alloydb test report (commit a13baec425) - ❌

⏲️ Total pipeline duration: 08mn00s

Step Result
Validate airbyte-integrations/connectors/source-alloydb/metadata.yaml
Connector version semver check
QA checks
Build connector tar
Build source-alloydb docker image for platform linux/x86_64
./gradlew :airbyte-integrations:connectors:source-alloydb:integrationTest
Acceptance tests

🔗 View the logs here

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-alloydb test

@octavia-squidington-iii
Copy link
Collaborator

source-mysql test report (commit a13baec425) - ❌

⏲️ Total pipeline duration: 22mn19s

Step Result
Validate airbyte-integrations/connectors/source-mysql/metadata.yaml
Connector version semver check
QA checks
Build connector tar
Build source-mysql docker image for platform linux/x86_64
./gradlew :airbyte-integrations:connectors:source-mysql:integrationTest
Acceptance tests

🔗 View the logs here

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

@octavia-squidington-iii
Copy link
Collaborator

source-alloydb-strict-encrypt test report (commit a13baec425) - ❌

⏲️ Total pipeline duration: 07mn40s

Step Result
Validate airbyte-integrations/connectors/source-alloydb-strict-encrypt/metadata.yaml
Connector version semver check
QA checks
Build connector tar
Build source-alloydb-strict-encrypt docker image for platform linux/x86_64
./gradlew :airbyte-integrations:connectors:source-alloydb-strict-encrypt:integrationTest
Acceptance tests

🔗 View the logs here

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-alloydb-strict-encrypt test

@octavia-squidington-iii
Copy link
Collaborator

source-postgres test report (commit a13baec425) - ✅

⏲️ Total pipeline duration: 18mn27s

Step Result
Validate airbyte-integrations/connectors/source-postgres/metadata.yaml
Connector version semver check
QA checks
Build connector tar
Build source-postgres docker image for platform linux/x86_64
./gradlew :airbyte-integrations:connectors:source-postgres:integrationTest
Acceptance tests

🔗 View the logs here

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-postgres test

@octavia-squidington-iii
Copy link
Collaborator

source-postgres-strict-encrypt test report (commit a13baec425) - ❌

⏲️ Total pipeline duration: 10mn19s

Step Result
Validate airbyte-integrations/connectors/source-postgres-strict-encrypt/metadata.yaml
Connector version semver check
QA checks
Build connector tar
Build source-postgres-strict-encrypt docker image for platform linux/x86_64
./gradlew :airbyte-integrations:connectors:source-postgres-strict-encrypt:integrationTest
Acceptance tests

🔗 View the logs here

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-postgres-strict-encrypt test

public static final String MYSQL_CDC_OFFSET = "mysql_cdc_offset";
public static final String MYSQL_DB_HISTORY = "mysql_db_history";

public JsonNode constructInitialDebeziumState(final Properties properties,
Copy link
Contributor

Choose a reason for hiding this comment

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

So this method is basically constructing the state from spinning up the DBZ engine and grabbing the state assc with the first record?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes and no! As discussed over call, we construct the offset by ourselves but in order to construct the db schema we need Debezium and thus we give Debezium the offset that we generated and run it with schema_only_recovery mode and it generates the schema history on its own and we use it.

public JsonNode constructInitialDebeziumState(final Properties properties,
final ConfiguredAirbyteCatalog catalog,
final JdbcDatabase database) {
// https://debezium.io/documentation/reference/2.2/connectors/mysql.html#mysql-property-snapshot-mode
Copy link
Contributor

@akashkulk akashkulk Jul 25, 2023

Choose a reason for hiding this comment

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

Can you just add a quick comment on the schema_only_recovery and why we use it?

return jsonNode;
}

private MysqlDebeziumStateAttributes getStateAttributesFromDB(final JdbcDatabase database) {
Copy link
Contributor

Choose a reason for hiding this comment

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

tiny nit : let's make this method public. I'm going to need it in the initial snapshotting code, so that we can attach the binlog_file + position for each record emitted in the initial pk sync

Copy link
Contributor

@akashkulk akashkulk left a comment

Choose a reason for hiding this comment

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

minor comments, looks good otherwise

@subodh1810
Copy link
Contributor Author

/approve-and-merge reason="change is not going to impact any current running connector cause its not being used"

@octavia-approvington
Copy link
Contributor

All in!!
all in baby

@octavia-approvington octavia-approvington merged commit bcb5a4d into master Jul 26, 2023
@octavia-approvington octavia-approvington deleted the mysql-cdc-initial-debezium-state branch July 26, 2023 11:18
@octavia-squidington-iii
Copy link
Collaborator

source-mssql-strict-encrypt test report (commit b0516ec1f9) - ❌

⏲️ Total pipeline duration: 18mn46s

Step Result
Validate airbyte-integrations/connectors/source-mssql-strict-encrypt/metadata.yaml
Connector version semver check
QA checks
Build connector tar
Build source-mssql-strict-encrypt docker image for platform linux/x86_64
./gradlew :airbyte-integrations:connectors:source-mssql-strict-encrypt:integrationTest
Acceptance tests

🔗 View the logs here

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-mssql-strict-encrypt test

@octavia-squidington-iii
Copy link
Collaborator

source-postgres-strict-encrypt test report (commit b0516ec1f9) - ❌

⏲️ Total pipeline duration: 13mn54s

Step Result
Validate airbyte-integrations/connectors/source-postgres-strict-encrypt/metadata.yaml
Connector version semver check
QA checks
Build connector tar
Build source-postgres-strict-encrypt docker image for platform linux/x86_64
./gradlew :airbyte-integrations:connectors:source-postgres-strict-encrypt:integrationTest
Acceptance tests

🔗 View the logs here

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-postgres-strict-encrypt test

@octavia-squidington-iii
Copy link
Collaborator

source-alloydb-strict-encrypt test report (commit b0516ec1f9) - ❌

⏲️ Total pipeline duration: 09mn13s

Step Result
Validate airbyte-integrations/connectors/source-alloydb-strict-encrypt/metadata.yaml
Connector version semver check
QA checks
Build connector tar
Build source-alloydb-strict-encrypt docker image for platform linux/x86_64
./gradlew :airbyte-integrations:connectors:source-alloydb-strict-encrypt:integrationTest
Acceptance tests

🔗 View the logs here

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-alloydb-strict-encrypt test

@octavia-squidington-iii
Copy link
Collaborator

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

⏲️ Total pipeline duration: 19mn54s

Step Result
Validate airbyte-integrations/connectors/source-mysql-strict-encrypt/metadata.yaml
Connector version semver check
QA checks
Build connector tar
Build source-mysql-strict-encrypt docker image for platform linux/x86_64
./gradlew :airbyte-integrations:connectors:source-mysql-strict-encrypt:integrationTest
Acceptance tests

🔗 View the logs here

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

@octavia-squidington-iii
Copy link
Collaborator

source-mysql test report (commit b0516ec1f9) - ❌

⏲️ Total pipeline duration: 25mn02s

Step Result
Validate airbyte-integrations/connectors/source-mysql/metadata.yaml
Connector version semver check
QA checks
Build connector tar
Build source-mysql docker image for platform linux/x86_64
./gradlew :airbyte-integrations:connectors:source-mysql:integrationTest
Acceptance tests

🔗 View the logs here

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

@octavia-squidington-iii
Copy link
Collaborator

source-postgres test report (commit b0516ec1f9) - ✅

⏲️ Total pipeline duration: 19mn42s

Step Result
Validate airbyte-integrations/connectors/source-postgres/metadata.yaml
Connector version semver check
QA checks
Build connector tar
Build source-postgres docker image for platform linux/x86_64
./gradlew :airbyte-integrations:connectors:source-postgres:integrationTest
Acceptance tests

🔗 View the logs here

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-postgres test

@octavia-squidington-iii
Copy link
Collaborator

source-alloydb test report (commit b0516ec1f9) - ❌

⏲️ Total pipeline duration: 10mn17s

Step Result
Validate airbyte-integrations/connectors/source-alloydb/metadata.yaml
Connector version semver check
QA checks
Build connector tar
Build source-alloydb docker image for platform linux/x86_64
./gradlew :airbyte-integrations:connectors:source-alloydb:integrationTest
Acceptance tests

🔗 View the logs here

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-alloydb test

@octavia-squidington-iii
Copy link
Collaborator

source-mssql test report (commit b0516ec1f9) - ❌

⏲️ Total pipeline duration: 24mn09s

Step Result
Validate airbyte-integrations/connectors/source-mssql/metadata.yaml
Connector version semver check
QA checks
Build connector tar
Build source-mssql docker image for platform linux/x86_64
./gradlew :airbyte-integrations:connectors:source-mssql:integrationTest
Acceptance tests

🔗 View the logs here

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-mssql 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.

4 participants