-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
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,
|
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
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