Add TopicClient.reset_offset to rewind a consumer's committed offsets. - #907
Open
nshestakov wants to merge 2 commits into
Open
nshestakov wants to merge 2 commits into
nshestakov wants to merge 2 commits into
Conversation
The RPC moves every partition, including inactive ones after split or merge, to earliest, latest, or the first message written at a given time. Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #907 +/- ##
==========================================
+ Coverage 82.66% 82.70% +0.03%
==========================================
Files 99 99
Lines 12953 12987 +34
Branches 1268 1273 +5
==========================================
+ Hits 10708 10741 +33
Misses 1794 1794
- Partials 451 452 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Build the protobuf timestamp from a known datetime so CopyFrom is not given an optional value. Co-authored-by: Cursor <cursoragent@cursor.com>
This branch has not been deployed
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.
Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
The topic client can commit an offset for one partition (
commit_offset) but cannot rewind a consumer's committed offsets. Python client forTopicService.ResetOffset, already available in the C++ SDK (ydb-platform/ydb#54149).Issue Number: N/A
What is the new behavior?
TopicClient.reset_offset/TopicClientAsyncIO.reset_offsetrewind a consumer's committed offsets on every topic partition, including inactive partitions left after a split or merge.A
datetimeselects the first message whose write timestamp is greater than or equal to that time. If no such message exists, the partition end offset is used.Partitions are updated independently: the call is not atomic, and a failure may still leave some partitions already rewritten. Any active read session of this consumer is dropped. The call is retried on cancellation the same way as
commit_offset.Other information
Stubs for protobuf 3–6 were regenerated with
ResetOffset.ydb-api-protosdoes not contain this RPC yet, so the submodule pointer is unchanged; the proto additions used for generation are not part of this commit. The next regeneration from the current pin will dropResetOffsetuntil that change lands inydb-api-protos.