Skip to content

Added MessageCommitter interface and implementation#610

Merged
alex268 merged 5 commits intoydb-platform:masterfrom
alex268:master
Mar 27, 2026
Merged

Added MessageCommitter interface and implementation#610
alex268 merged 5 commits intoydb-platform:masterfrom
alex268:master

Conversation

@alex268
Copy link
Copy Markdown
Member

@alex268 alex268 commented Mar 26, 2026

No description provided.

@alex268 alex268 requested a review from pnv1 March 26, 2026 15:54
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 26, 2026

Codecov Report

❌ Patch coverage is 68.02721% with 47 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.87%. Comparing base (7c484d8) to head (3828672).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
...tech/ydb/topic/read/impl/ReadPartitionSession.java 73.17% 8 Missing and 3 partials ⚠️
...ech/ydb/topic/read/impl/DeferredCommitterImpl.java 42.85% 8 Missing ⚠️
...tech/ydb/topic/read/impl/MessageCommitterImpl.java 80.00% 6 Missing and 2 partials ⚠️
.../java/tech/ydb/topic/read/impl/SyncReaderImpl.java 0.00% 8 Missing ⚠️
...ain/java/tech/ydb/topic/read/impl/ReadSession.java 66.66% 6 Missing ⚠️
.../java/tech/ydb/topic/read/impl/MessageDecoder.java 66.66% 2 Missing ⚠️
.../topic/read/impl/events/DataReceivedEventImpl.java 80.00% 2 Missing ⚠️
.../java/tech/ydb/topic/description/OffsetsRange.java 50.00% 1 Missing ⚠️
...ain/java/tech/ydb/topic/read/impl/MessageImpl.java 80.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #610      +/-   ##
============================================
- Coverage     68.92%   68.87%   -0.06%     
- Complexity     3131     3133       +2     
============================================
  Files           355      359       +4     
  Lines         15304    15328      +24     
  Branches       1621     1621              
============================================
+ Hits          10549    10557       +8     
- Misses         4094     4109      +15     
- Partials        661      662       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new commit abstraction (MessageCommitter) for topic reader message/event commits, decoupling commit handling from ReadPartitionSession internals and updating reader components/tests to use commit ranges.

Changes:

  • Added MessageCommitter API and a MessageCommitterImpl implementation to manage commit futures and commit requests.
  • Refactored Message and DataReceivedEvent to expose getRangeToCommit() and a session-bound getCommitter(), with commit() becoming a default method.
  • Updated reader/session internals (ReadPartitionSession, ReadSession, sync reader, deferred committer) and adapted tests accordingly.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
topic/src/main/java/tech/ydb/topic/read/MessageCommitter.java New public interface for committing ranges/messages.
topic/src/main/java/tech/ydb/topic/read/impl/MessageCommitterImpl.java New implementation backing commit futures and confirmations.
topic/src/main/java/tech/ydb/topic/read/Message.java Adds commit range + committer, makes commit() a default method; deprecates offsets accessor.
topic/src/main/java/tech/ydb/topic/read/events/DataReceivedEvent.java Adds commit range + committer, makes commit() a default method; deprecates offsets accessor.
topic/src/main/java/tech/ydb/topic/read/impl/MessageImpl.java Wires messages to MessageCommitter + commit range.
topic/src/main/java/tech/ydb/topic/read/impl/events/DataReceivedEventImpl.java Provides event commit range + committer instead of direct session commits.
topic/src/main/java/tech/ydb/topic/read/impl/ReadPartitionSession.java Moves commit handling to MessageCommitterImpl and introduces per-message commit ranges.
topic/src/main/java/tech/ydb/topic/read/impl/ReadSession.java Adapts partition session lifecycle/commit confirmation to the new committer flow.
topic/src/main/java/tech/ydb/topic/read/impl/DeferredCommitterImpl.java Refactors deferred commit batching to group by MessageCommitter.
topic/src/main/java/tech/ydb/topic/read/impl/DisjointOffsetRangeSet.java Simplifies API from adding collections to adding single ranges.
topic/src/main/java/tech/ydb/topic/read/impl/SyncReaderImpl.java Updates transaction offset updates to use commit ranges.
topic/src/main/java/tech/ydb/topic/read/impl/MessageDecoder.java Renames “id” parameter to “traceID” in decoding tasks.
topic/src/main/java/tech/ydb/topic/read/TransactionMessageAccumulator.java Marks the interface as deprecated.
topic/src/main/java/tech/ydb/topic/description/OffsetsRange.java Adds OffsetsRange.of(...) factories.
topic/src/test/java/tech/ydb/topic/impl/DisjointOffsetRangeSetTest.java Updates tests to match new DisjointOffsetRangeSet.add(...) signature.
topic/src/test/java/tech/ydb/topic/impl/TopicReadersIntegrationTest.java Adds a test timeout rule and an ignored test scenario for retention-like behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alex268 alex268 merged commit 319836b into ydb-platform:master Mar 27, 2026
13 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants