Repository navigation
[Source-MySQL] Enhanced Standard sync with PK initial load -> Cursor based switch over - #30270
Conversation
Before Merging a Connector Pull RequestWow! 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:
If the checklist is complete, but the CI check is failing,
|
There was a problem hiding this comment.
Why is a change to this file needed?
There was a problem hiding this comment.
We should escape quote cursor fields like in this PR : https://github.com/airbytehq/airbyte/pull/30059/files
There was a problem hiding this comment.
Why are we deleting this code?
There was a problem hiding this comment.
I moved this to the Utils class so I can use it as well
There was a problem hiding this comment.
can we move this back now that this is only being used in here! Just trying to minimise the changes.
There was a problem hiding this comment.
I'm good with that! On it
There was a problem hiding this comment.
Can we move this to MySqlInitialReadUtil? I assume this is the code that is doing the main logic of figuring out which streams to sync via pk?
There was a problem hiding this comment.
Moved it! I actually eliminated the filtering based on state_type = cursor_based since anything that's not PK is implicitly cursor_based.
There was a problem hiding this comment.
This is similar to the PostgresCursorBasedStateManager class correct? Basically just to enable writing the state_type and version keys? Can we add a comment for that
IIRC we had a ticket to refactor this in StreamStateManager when we implemented source-mysql - do you think we should do that here?
There was a problem hiding this comment.
can we remove this and just keep InitialLoadStreams? Anything that is not in InitialLoadStreams would implicitly be a cursor based streams right?
There was a problem hiding this comment.
Yep! Addressed above.
|
| Step | Result |
|---|---|
| Java Connector Unit Tests | ✅ |
| Build connector tar | ✅ |
| Build source-snowflake docker image for platform linux/x86_64 | ✅ |
| Java Connector Integration Tests | ❌ |
| Acceptance tests | ✅ |
| Validate airbyte-integrations/connectors/source-snowflake/metadata.yaml | ✅ |
| Connector version semver check | ✅ |
| QA checks | ✅ |
☁️ 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-snowflake test
Coverage report for source-postgres
|
|
| Step | Result |
|---|---|
| Java Connector Unit Tests | ❌ |
| Build connector tar | ✅ |
| Build source-cockroachdb docker image for platform linux/x86_64 | ✅ |
| Java Connector Integration Tests | ❌ |
| Acceptance tests | ✅ |
| Validate airbyte-integrations/connectors/source-cockroachdb/metadata.yaml | ✅ |
| Connector version semver check | ✅ |
| QA checks | ✅ |
☁️ 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-cockroachdb test
|
| 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 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
|
| Step | Result |
|---|---|
| Java Connector Unit Tests | ✅ |
| Build connector tar | ✅ |
| Build source-oracle-strict-encrypt docker image for platform linux/x86_64 | ✅ |
| Java Connector Integration Tests | ❌ |
| Acceptance tests | ❌ |
| Validate airbyte-integrations/connectors/source-oracle-strict-encrypt/metadata.yaml | ✅ |
| Connector version semver check | ✅ |
| QA checks | ✅ |
☁️ 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-oracle-strict-encrypt test
|
| Step | Result |
|---|---|
| Java Connector Unit Tests | ✅ |
| Build connector tar | ✅ |
| Build source-postgres docker image for platform linux/x86_64 | ✅ |
| Java Connector Integration Tests | ✅ |
| Acceptance tests | ✅ |
| Validate airbyte-integrations/connectors/source-postgres/metadata.yaml | ✅ |
| Connector version semver check | ✅ |
| QA checks | ✅ |
☁️ 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-postgres test
|
| Step | Result |
|---|---|
| Build connector tar | ❌ |
| Validate airbyte-integrations/connectors/source-mysql-strict-encrypt/metadata.yaml | ✅ |
| Connector version semver check | ✅ |
| Connector version increment check | ✅ |
| QA checks | ❌ |
☁️ 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
|
| 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 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
|
| Step | Result |
|---|---|
| Build connector tar | ✅ |
| Build source-postgres docker image for platform linux/x86_64 | ✅ |
| Java Connector Unit Tests | ✅ |
| Java Connector Integration Tests | ✅ |
| Acceptance tests | ✅ |
| Validate airbyte-integrations/connectors/source-postgres/metadata.yaml | ✅ |
| Connector version semver check | ✅ |
| Connector version increment check | ❌ |
| QA checks | ✅ |
☁️ 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-postgres test
|
| Step | Result |
|---|
☁️ 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-mssql testWIP WIP Functional feature done
372e55d to
b0c1071
Compare
|
/approve-and-merge reason="ci passes and features are gated behind flag". Source-postgres and mssql changes are non-functional. " |
|
| 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 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
|
| Step | Result |
|---|
☁️ 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-mssql test
|
| Step | Result |
|---|---|
| Build connector tar | ✅ |
| Build source-postgres docker image for platform linux/x86_64 | ✅ |
| Java Connector Unit Tests | ✅ |
| Java Connector Integration Tests | ✅ |
| Acceptance tests | ✅ |
| Validate airbyte-integrations/connectors/source-postgres/metadata.yaml | ✅ |
| Connector version semver check | ✅ |
| Connector version increment check | ❌ |
| QA checks | ✅ |
☁️ 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-postgres test
|
| 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 | ✅ |
| QA checks | ❌ |
☁️ 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
What
Utilize Primary keys for initial sync then switch over to user defined cursor once high water mark is found and persisted in state.
How
With normal incremental syncs now, we will be using Primary key for the initial sync and retrieve the high water mark in the beginning and construct all of the relevant Primary Key and Standard Sync iterators at the beginning of the sync.
This includes a
SELECT MAXquery to retrieve max cursor value and populate the initial and final StreamState to provide a checkpoint so that there won't be any missing records on subsequent syncs.Note: The
getIncrementalIteratorsmethod in theMysqlInitialLoadHandlerclass now has logic to handle the edge case of when the customer de-select a primary key column. Solution here is to re-add the column names to theselectedDatabaseFieldsin order to construct the correctSELECTquery, but those columns will not be part of the record as theCatalogHelpers.getTopLevelFieldNames(airbyteStream)will not include the de-selected fields.Tests with flag turned on is in the file
MySqlPkJdbcSourceAcceptanceTest.java