Skip to content

Added support of RetryConfig to topic writers#637

Merged
alex268 merged 10 commits intoydb-platform:masterfrom
alex268:master
Apr 22, 2026
Merged

Added support of RetryConfig to topic writers#637
alex268 merged 10 commits intoydb-platform:masterfrom
alex268:master

Conversation

@alex268
Copy link
Copy Markdown
Member

@alex268 alex268 commented Apr 17, 2026

No description provided.

@alex268 alex268 requested a review from pnv1 April 17, 2026 14:27
@pnv1 pnv1 requested a review from Copilot April 17, 2026 14:31
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

Adds configurable retry behavior to Topic writers by introducing RetryConfig into writer settings and moving the writer stream lifecycle to the shared retryable-stream infrastructure, along with additional tests around shutdown/close behavior and retry scenarios.

Changes:

  • Add RetryConfig support to WriterSettings and wire it into writer stream creation/retry logic.
  • Refactor writer implementation to use TopicRetryableStream-based WriteSession / WriteStream.
  • Expand tests: buffer-manager close semantics and integration tests that inject failures and validate retries / written data.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
topic/src/main/java/tech/ydb/topic/settings/WriterSettings.java Adds RetryConfig to writer settings + builder API and default value.
topic/src/main/java/tech/ydb/topic/settings/TopicRetryConfig.java Introduces default retry config used by writers.
topic/src/main/java/tech/ydb/topic/impl/TopicRetryableStream.java Retryable stream base updated (logging, debug id field).
topic/src/main/java/tech/ydb/topic/write/impl/WriterImpl.java Refactors writer lifecycle around WriteSession/retryable streams.
topic/src/main/java/tech/ydb/topic/write/impl/WriteSession.java Migrates session logic to TopicRetryableStream and adds writer callbacks.
topic/src/main/java/tech/ydb/topic/write/impl/WriteStream.java New TopicStream wrapper for write RPC + status parsing.
topic/src/main/java/tech/ydb/topic/write/impl/WriterQueue.java Adds close handling, debug-id logging, and seqNo update behavior tweaks.
topic/src/main/java/tech/ydb/topic/write/impl/BufferManager.java Adds close status + unblocking of waiters and closed checks on acquire paths.
topic/src/main/java/tech/ydb/topic/write/impl/MessageSender.java Adds debug-id logging for request send ranges.
topic/src/main/java/tech/ydb/topic/write/impl/EnqueuedMessage.java Renames error field from encoding-only to generic problem.
topic/src/test/java/tech/ydb/topic/write/impl/BufferManagerTest.java Adds tests validating acquire behavior when buffer is closed.
topic/src/test/java/tech/ydb/topic/TopicWritersIntegrationTest.java New integration test location + retry/failure-injection scenario validation.
topic/src/test/java/tech/ydb/topic/FailableWriterInterceptor.java New gRPC interceptor for injecting init/ack/send failures in tests.
topic/src/test/java/tech/ydb/topic/impl/TopicWritersIntegrationTest.java Removed (relocated to tech.ydb.topic).

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

Comment thread topic/src/main/java/tech/ydb/topic/write/impl/WriterImpl.java
Comment thread topic/src/main/java/tech/ydb/topic/write/impl/WriterImpl.java
Comment thread topic/src/main/java/tech/ydb/topic/write/impl/MessageSender.java Outdated
Comment thread topic/src/main/java/tech/ydb/topic/settings/WriterSettings.java
Comment thread topic/src/test/java/tech/ydb/topic/write/impl/BufferManagerTest.java Outdated
Comment thread topic/src/test/java/tech/ydb/topic/write/impl/BufferManagerTest.java Outdated
Comment thread topic/src/main/java/tech/ydb/topic/write/impl/WriteSession.java
Comment thread topic/src/main/java/tech/ydb/topic/write/impl/WriterImpl.java
Comment thread topic/src/main/java/tech/ydb/topic/impl/TopicRetryableStream.java
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 17, 2026

Codecov Report

❌ Patch coverage is 87.21461% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.86%. Comparing base (41369f3) to head (c069b4e).

Files with missing lines Patch % Lines
...n/java/tech/ydb/topic/write/impl/WriteSession.java 76.92% 8 Missing and 4 partials ⚠️
.../java/tech/ydb/topic/write/impl/BufferManager.java 85.71% 5 Missing and 2 partials ⚠️
...in/java/tech/ydb/topic/write/impl/WriteStream.java 57.14% 3 Missing ⚠️
...n/java/tech/ydb/topic/settings/WriterSettings.java 71.42% 1 Missing and 1 partial ⚠️
.../java/tech/ydb/topic/write/impl/MessageSender.java 66.66% 1 Missing and 1 partial ⚠️
...in/java/tech/ydb/topic/write/impl/WriterQueue.java 93.93% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #637      +/-   ##
============================================
+ Coverage     70.58%   70.86%   +0.28%     
- Complexity     3291     3310      +19     
============================================
  Files           372      374       +2     
  Lines         15640    15699      +59     
  Branches       1638     1650      +12     
============================================
+ Hits          11039    11125      +86     
+ Misses         3948     3929      -19     
+ Partials        653      645       -8     

☔ 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

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


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

Comment thread topic/src/test/java/tech/ydb/topic/write/impl/WriterImplTest.java Outdated
Comment thread topic/src/test/java/tech/ydb/topic/TopicWritersIntegrationTest.java
Comment thread topic/src/main/java/tech/ydb/topic/impl/TopicRetryableStream.java
Comment thread topic/src/main/java/tech/ydb/topic/settings/WriterSettings.java Outdated
Comment thread topic/src/test/java/tech/ydb/topic/write/impl/WriterImplTest.java Outdated
Comment thread topic/src/main/java/tech/ydb/topic/settings/TopicRetryConfig.java
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

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


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

Comment thread topic/src/main/java/tech/ydb/topic/write/impl/WriterImpl.java
Comment thread topic/src/main/java/tech/ydb/topic/write/impl/BufferManager.java
Comment thread topic/src/test/java/tech/ydb/topic/TopicWritersIntegrationTest.java
@alex268 alex268 merged commit 364f2c9 into ydb-platform:master Apr 22, 2026
10 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