Skip to content

Fixed StartPartitionSessionResponse for reading without consumer#667

Merged
alex268 merged 1 commit into
ydb-platform:masterfrom
alex268:master
Jun 16, 2026
Merged

Fixed StartPartitionSessionResponse for reading without consumer#667
alex268 merged 1 commit into
ydb-platform:masterfrom
alex268:master

Conversation

@alex268

@alex268 alex268 commented Jun 16, 2026

Copy link
Copy Markdown
Member

No description provided.

@codecov-commenter

codecov-commenter commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.69%. Comparing base (1ae339e) to head (6ad42bc).

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #667      +/-   ##
============================================
+ Coverage     71.68%   71.69%   +0.01%     
  Complexity     3429     3429              
============================================
  Files           386      386              
  Lines         16071    16070       -1     
  Branches       1688     1688              
============================================
+ Hits          11520    11522       +2     
+ Misses         3900     3896       -4     
- Partials        651      652       +1     

☔ View full report in Codecov by Harness.
📢 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.

Comment thread topic/src/main/java/tech/ydb/topic/read/impl/ReadSession.java Outdated
Comment thread topic/src/main/java/tech/ydb/topic/read/impl/ReadSession.java
@robot-vibe-db

robot-vibe-db Bot commented Jun 16, 2026

Copy link
Copy Markdown

AI Review Summary

Verdict: ✅ No critical issues found

Critical issues

No critical issues found.

Other findings

  • Minor | Medium: The readFrom != 0 / commitTo != 0 check conflates "offset value is zero" with "field should be unset." If a user explicitly sets readOffset(0L) via StartPartitionSessionSettings when the committed offset is non-zero, the readOffset field won't be set in the protobuf response. This is an unlikely edge case in practice but represents a semantic gap. — topic/src/main/java/tech/ydb/topic/read/impl/ReadSession.java:222
  • Nit | High: The log message at line 236 still interpolates consumerName, which is null when reading without a consumer, producing consumer "null" in the output. — topic/src/main/java/tech/ydb/topic/read/impl/ReadSession.java:236

This review was generated automatically. Critical issues require attention; other findings are advisory.
If this comment was useful, please give it a 👍 — it helps us improve the review bot.

@robot-vibe-db

robot-vibe-db Bot commented Jun 16, 2026

Copy link
Copy Markdown

Full analysis log

Analysis performed by claude, claude-opus-4-6.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adjusts how the SDK forms StartPartitionSessionResponse so that readOffset / commitOffset are only sent when explicitly configured, which is necessary for correct “read without consumer” behavior in the topic reader. It also updates/extends integration tests to cover reading with and without a consumer, and with explicit partition IDs.

Changes:

  • Build StartPartitionSessionResponse once and set readOffset/commitOffset only when present in StartPartitionSessionSettings.
  • Refactor reader integration tests to use CountDownLatch-based assertions and add coverage for reading by partition id and without a consumer.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
topic/src/main/java/tech/ydb/topic/read/impl/ReadSession.java Changes StartPartitionSessionResponse construction so optional offsets are omitted unless explicitly set.
topic/src/test/java/tech/ydb/topic/TopicReadersIntegrationTest.java Updates synchronization approach and adds integration scenarios for partition-id reads and consumer-less reads.

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

Comment thread topic/src/main/java/tech/ydb/topic/read/impl/ReadSession.java
Comment thread topic/src/test/java/tech/ydb/topic/TopicReadersIntegrationTest.java
Comment thread topic/src/test/java/tech/ydb/topic/TopicReadersIntegrationTest.java
Comment thread topic/src/test/java/tech/ydb/topic/TopicReadersIntegrationTest.java
@alex268 alex268 merged commit d332c93 into ydb-platform:master Jun 16, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants