feat(connectors): let sinks control when offsets are committed - #3954
Open
kriti-sc wants to merge 1 commit into
Open
feat(connectors): let sinks control when offsets are committed#3954kriti-sc wants to merge 1 commit into
kriti-sc wants to merge 1 commit into
Conversation
|
Thanks for the PR. It is labeled Slash commands (own line, regular comment) move it around the queue:
See CONTRIBUTING.md for details. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3954 +/- ##
============================================
- Coverage 83.85% 83.76% -0.10%
Complexity 1358 1358
============================================
Files 1212 1212
Lines 166843 166900 +57
Branches 134304 134487 +183
============================================
- Hits 139905 139800 -105
- Misses 23298 23305 +7
- Partials 3640 3795 +155
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2928, #2927
Related: #3203
Rationale
Sinks must have an option to decide exactly when it is safe to advance the offset, as only the sink knows when a write is truly durable from the target's perspective.
What changed?
This PR adds an
offset_commitsetting to sink configs:after_polling(default) - existing behaviour of offset being committed when messages are polled. Nothing changes for existing configs.after_consuming- the offset is stored only once the sink reports that it wrote the batch.The offset commit decision hinges upon the i32 returned by the sink.
This also required binding the i32 returned by the sink, which was previous discarded. Now, the sink exits if i32 != 0, regardless of offset commit configuration, which is the correct behaviour as a sink returns error for failures lying outside its purview.
This PR also introduces integration tests that inject failures into a running sink and verify the desired commit behaviour.