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

🐛 source-mssql: support Read Committed snapshot isolation level #28545

Merged
merged 7 commits into from
Aug 1, 2023

Conversation

sh4sh
Copy link
Contributor

@sh4sh sh4sh commented Jul 20, 2023

What

Fixes #28543

How

This PR modifies two functions getSnapshotIsolationConfig, getDataToSyncConfig and their applicable tests so that they are able to access the current connector config values.

Recommended reading order

  1. airbyte-integrations/connectors/source-mssql/src/main/java/io/airbyte/integrations/source/mssql/MssqlCdcHelper.java
  2. airbyte-integrations/connectors/source-mssql/src/test/java/io/airbyte/integrations/source/mssql/MssqlCdcHelperTest.java

🚨 User Impact 🚨

This is a patch fix and should not cause breaking changes.

Pre-merge Actions

Expand the relevant checklist and delete the others.

Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Unit & integration tests added

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.

@sh4sh sh4sh requested a review from a team as a code owner July 20, 2023 21:21
@github-actions
Copy link
Contributor

github-actions bot commented Jul 20, 2023

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.

@@ -120,8 +120,8 @@ static boolean isCdc(final JsonNode config) {
@VisibleForTesting
static SnapshotIsolation getSnapshotIsolationConfig(final JsonNode config) {
// new replication method config since version 0.4.0
if (config.hasNonNull(REPLICATION_FIELD)) {
final JsonNode replicationConfig = config.get(REPLICATION_FIELD);
if (config.hasNonNull(LEGACY_REPLICATION_FIELD) && config.get(LEGACY_REPLICATION_FIELD).isObject()) {
Copy link
Contributor Author

@sh4sh sh4sh Jul 20, 2023

Choose a reason for hiding this comment

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

Maybe I should also add isText case to these as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

.isTextual() is for when replication_method was a string
.isObject() I think is suitable for a oneOf selection field.
Current implementation is with oneOf so it sounds like this is correct (?)

@sh4sh sh4sh requested a review from marcosmarxm July 20, 2023 21:29
@sh4sh
Copy link
Contributor Author

sh4sh commented Jul 20, 2023

todo: bump version (patch) and add changelog

@sh4sh sh4sh changed the title 🐛 source-mssql: support read committed snapshot isolation level 🐛 source-mssql: support Read Committed snapshot isolation level Jul 20, 2023
@octavia-squidington-iii
Copy link
Collaborator

source-mssql-strict-encrypt test report (commit 9c7d5a46cb) - ✅

⏲️ Total pipeline duration: 16mn05s

Step Result

🔗 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-mssql test report (commit 9c7d5a46cb) - ✅

⏲️ Total pipeline duration: 19mn22s

Step Result

🔗 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

@rodireich
Copy link
Contributor

@sh4sh This Looks good to me.
I just wonder if the pre-0.4.0 support is still something we need to keep.
Together with the back and forth on "replication_method" to "replication" and back, This is the most confusing piece of code

@octavia-squidington-iii
Copy link
Collaborator

source-mssql test report (commit 60ccd4880d) - ✅

⏲️ Total pipeline duration: 46.65s

Step Result

🔗 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

@octavia-squidington-iii octavia-squidington-iii added the area/documentation Improvements or additions to documentation label Jul 24, 2023
@marcosmarxm
Copy link
Member

I said to Sunny probably we can work in a next PR to remove all confusing code between legacy and the other one.

@octavia-squidington-iii
Copy link
Collaborator

source-mssql-strict-encrypt test report (commit 60ccd4880d) - ✅

⏲️ Total pipeline duration: 16mn11s

Step Result

🔗 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-mssql test report (commit 1b88d0ec43) - ✅

⏲️ Total pipeline duration: 18mn01s

Step Result

🔗 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

@octavia-squidington-iii
Copy link
Collaborator

source-mssql-strict-encrypt test report (commit 1b88d0ec43) - ❌

⏲️ Total pipeline duration: 15mn28s

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

@sh4sh
Copy link
Contributor Author

sh4sh commented Jul 26, 2023

Until we figure out what's up with the tests, I published a pre-release here for the user to try out: https://hub.docker.com/layers/airbyte/source-mssql/1.1.1-dev.91cb51d107/images/sha256-ae1f56d0b8a3a1a059868156c63f256572a4be55cc0ad7968ae3c6aac579c889

@sh4sh
Copy link
Contributor Author

sh4sh commented Jul 27, 2023

The user who reported this issue tested the fix and confirmed it works 👍

@octavia-squidington-iii
Copy link
Collaborator

source-mssql-strict-encrypt test report (commit 4e9738166e) - ❌

⏲️ Total pipeline duration: 12mn14s

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

@sh4sh
Copy link
Contributor Author

sh4sh commented Aug 1, 2023

/approve-and-merge reason="bug fix, tested separately as connector currently failing on master"

@octavia-approvington
Copy link
Contributor

It's time
fine lets go

@octavia-approvington octavia-approvington merged commit 6df99b2 into master Aug 1, 2023
@octavia-approvington octavia-approvington deleted the sh4sh/mssql-snapshot-isolation branch August 1, 2023 21:37
@octavia-squidington-iii
Copy link
Collaborator

source-mssql test report (commit 4e9738166e) - ❌

⏲️ Total pipeline duration: 305mn05s

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

bnchrch pushed a commit that referenced this pull request Aug 3, 2023
…8545)

* make getSnapshotIsolationConfig grab the correct config

* add object case for getDataToSyncConfig and getSnapshotIsolationConfig

* update tests to use current config parameters

* bump connector version

* add changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation checklist-action-run connectors/source/mssql
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 source-mssql: connector forces snapshot isolation level
5 participants