Skip to content

πŸ› Only take table size info for streams syncing via primary key - #30375

Merged
Octavia The Approver (octavia-approvington) merged 8 commits into
masterfrom
30363-source-mysql-error-when-reading-table-size-causing-syncs-to-fail
Sep 13, 2023
Merged

πŸ› Only take table size info for streams syncing via primary key#30375
Octavia The Approver (octavia-approvington) merged 8 commits into
masterfrom
30363-source-mysql-error-when-reading-table-size-causing-syncs-to-fail

Conversation

@rodireich

@rodireich Rodi Reich Zilberman (rodireich) commented Sep 13, 2023

Copy link
Copy Markdown
Contributor

What

If at least one stream is syncing via primary key, we attempt to get table info size for all,
including full refresh streams and views.
Because views don't have physical byte size we run into an error.
Closes #30363.

How

Only take table info size for the streams that need it, namely primary key syncing streams.

@github-actions

github-actions Bot commented Sep 13, 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.

@rodireich Rodi Reich Zilberman (rodireich) changed the title Only take table size info for streams syncing via primary key πŸ› Only take table size info for streams syncing via primary key Sep 13, 2023
@github-actions

Copy link
Copy Markdown
Contributor

source-mysql test report (commit 7adcec95dc) - ❌

⏲️ Total pipeline duration: 321mn19s

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 f399d58161) - ❌

⏲️ Total pipeline duration: 322mn53s

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 f399d58161) - ❌

⏲️ Total pipeline duration: 40mn08s

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 βœ…
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

@subodh1810 Subodh Chaturvedi (subodh1810) left a comment

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.

We should just swallow any exception in the method getTableSizeInfoForStreams in class MySqlQueryUtils. We are already swallowing SQLException.

Also add a null check in that method for values before trying to parse them to long

@rodireich

Copy link
Copy Markdown
Contributor Author

I see that in case there is no table size info, MySqlInitialLoadHandler would fall back to a default chunk size of 1m rows

    if (tableSizeInfo == null || tableSizeInfo.tableSize() == 0 || tableSizeInfo.avgRowLength() == 0) {
      LOGGER.info("Chunk size could not be determined for pair: {}, defaulting to {} rows", pair, DEFAULT_CHUNK_SIZE);
      return DEFAULT_CHUNK_SIZE;
    }

I'll add the suggested change so we never fail a sync due to table size failure

@rodireich

Rodi Reich Zilberman (rodireich) commented Sep 13, 2023

Copy link
Copy Markdown
Contributor Author

/legacy-test connector=connectors/source-mysql

πŸ•‘ connectors/source-mysql https://github.com/airbytehq/airbyte/actions/runs/6175707390
❌ connectors/source-mysql https://github.com/airbytehq/airbyte/actions/runs/6175707390
πŸ› https://gradle.com/s/ihgfidlelrf5w

Build Failed

Test summary info:

Could not find result summary

@github-actions

Copy link
Copy Markdown
Contributor

source-mysql-strict-encrypt test report (commit 3aa0010287) - ❌

⏲️ Total pipeline duration: 42mn21s

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 βœ…
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

@rodireich

Copy link
Copy Markdown
Contributor Author

All tests passing locally

@prateekmukhedkar

Prateek Mukhedkar (prateekmukhedkar) commented Sep 13, 2023

Copy link
Copy Markdown
Contributor

/legacy-test connector=connectors/source-mysql

πŸ•‘ connectors/source-mysql https://github.com/airbytehq/airbyte/actions/runs/6176609667
❌ connectors/source-mysql https://github.com/airbytehq/airbyte/actions/runs/6176609667
πŸ› https://gradle.com/s/45tytjy5zv43c

Build Failed

Test summary info:

Could not find result summary

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 as discussed over call. Please make sure to the tests are green locally (CI is broken) before merging.

@rodireich

Copy link
Copy Markdown
Contributor Author

/approve-and-merge reason="Tests pass for MySQL locally, CI is broken for mysql"

@octavia-approvington

Copy link
Copy Markdown
Contributor

Lets merge it
sheep thumbs up

@octavia-approvington
Octavia The Approver (octavia-approvington) deleted the 30363-source-mysql-error-when-reading-table-size-causing-syncs-to-fail branch September 13, 2023 19:35
@github-actions

Copy link
Copy Markdown
Contributor

source-mysql test report (commit 3aa0010287) - ❌

⏲️ Total pipeline duration: 319mn32s

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 c603e18c66) - ❌

⏲️ Total pipeline duration: 322mn19s

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 c603e18c66) - ❌

⏲️ Total pipeline duration: 39mn27s

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 βœ…
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.

[source-mysql] Error when reading table size causing syncs to fail

5 participants