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-mongodb-v2] : Fail sync if initial snapshot for any stream fails #34759

Merged
merged 4 commits into from Feb 5, 2024

Conversation

akashkulk
Copy link
Contributor

@akashkulk akashkulk commented Feb 1, 2024

Currently, if the initial snapshot associated with any stream fails, we keep moving onto the next stream. In general, a failing stream should NOT stall progress on existing syncs. However with the way the current connectors are set up, this shows up as a successful sync.

The side-effect of this is that the platform schedules the next sync at the next configured scheduled time. In reality, since the initial snapshot is incomplete, a subsequent sync should be scheduled immediately to make sure the snapshot is completed as soon as possible.

With this change, a failed snapshot for a stream fails the entire sync. The platform retry logic will kick in and continue scheduling syncs until the snapshots are completed***
This also brings the MongoDb behavior at parity with source-postgres and source-mysql.
*Caveat : The sync will fail after 10 attempt

Closes #34392

In the future, perhaps a new protocol message can be emitted to indicate that an initial sync is occurring. The platform can keep scheduling retries in this case until that it no longer sees that message

Copy link

vercel bot commented Feb 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Feb 2, 2024 7:55pm

Copy link
Contributor

github-actions bot commented Feb 1, 2024

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.

@octavia-squidington-iii octavia-squidington-iii added the area/documentation Improvements or additions to documentation label Feb 1, 2024
@akashkulk akashkulk marked this pull request as ready for review February 1, 2024 23:09
iterThrewException = true;
// If hasNext throws an exception, log it and set the flag to indicate that the initial snapshot failed. This indicates to the main iterator
// to emit state associated with what has been processed so far.
initialSnapshotFailed = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not throe and exception here instead?
Wouldn't that to the same job?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ideally, yes. But we still want to emit the final state before throwing an exception

@akashkulk akashkulk merged commit c7c51ea into master Feb 5, 2024
23 checks passed
@akashkulk akashkulk deleted the akash/mongo-sync-fail branch February 5, 2024 17:15
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 21, 2024
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 26, 2024
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 26, 2024
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 26, 2024
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 connectors/source/mongodb-v2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Source-Mongo] : Discrepancies in initial sync compared to Postgres
3 participants