Skip to content

πŸ› source-mssql: support Read Committed snapshot isolation level - #28545

Merged
Octavia The Approver (octavia-approvington) merged 7 commits into
masterfrom
sh4sh/mssql-snapshot-isolation
Aug 1, 2023
Merged

Octavia The Approver (octavia-approvington) merged 7 commits into
masterfrom
sh4sh/mssql-snapshot-isolation

Conversation

@sh4sh

Copy link
Copy Markdown
Contributor

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.

@github-actions

github-actions Bot commented Jul 20, 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.

// 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()) {

@sh4sh sunny (sh4sh) Jul 20, 2023 •

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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

sunny (sh4sh) commented Jul 20, 2023 •

Copy link
Copy Markdown
Contributor Author

todo: bump version (patch) and add changelog

@sh4sh sunny (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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

sunny (@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
Copy Markdown
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 (octavia-squidington-iii) added the area/documentation Improvements or additions to documentation label Jul 24, 2023
@marcosmarxm

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

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
Copy Markdown
Contributor Author

The user who reported this issue tested the fix and confirmed it works πŸ‘

@octavia-squidington-iii

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

@octavia-approvington

Copy link
Copy Markdown
Contributor

It's time
fine lets go

@octavia-squidington-iii

Copy link
Copy Markdown
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

Ben Church (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