Repository navigation
[ISSUE #11579] Persist RocksDB consumer offsets incrementally in asynchronous batches - #11580
Merged
lizhimins merged 3 commits intoNov 27, 2026
Conversation
f1amingo
force-pushed
the
enhancement/async-batch-consumer-offset-persist
branch
from
November 23, 2026 08:22
3909860 to
c4c5b4e
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #11580 +/- ##
=============================================
+ Coverage 49.89% 51.02% +1.12%
- Complexity 14464 14966 +502
=============================================
Files 1391 1391
Lines 103438 103910 +472
Branches 13551 13633 +82
=============================================
+ Hits 51610 53015 +1405
+ Misses 45601 44690 -911
+ Partials 6227 6205 -22 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…n asynchronous batches - Batch incremental offset writes through a deduplicated background persister - Drain pending offsets and sync WAL on persist and stop - Add checked WAL flush to surface flush failures - Persist all config managers before closing the shared RocksDB on shutdown - Add tests for batching, deletion, stop and shared RocksDB shutdown
f1amingo
force-pushed
the
enhancement/async-batch-consumer-offset-persist
branch
from
November 23, 2026 09:08
c4c5b4e to
9df3035
Compare
- Advance versions in memory and persist them during offset persistence and shutdown. - Preallocate the selected-key buffer and verify commits proceed during slow version writes.
ShannonDing
requested review from
RongtongJin and
yx9o
and removed request for
RongtongJin
November 23, 2026 12:07
f1amingo
force-pushed
the
enhancement/async-batch-consumer-offset-persist
branch
from
November 26, 2026 15:55
7b4d6a7 to
9e14011
Compare
- Add a configurable 100ms fixed-delay interval and use 2500-key/512KiB batches. - Skip dirty-key registration for unchanged offsets while preserving version updates. - Retain all queue offsets during concurrent first commits with putIfAbsent. - Log successful batch limits outside locks at most once per minute. - Cover interval lifecycle, unchanged offsets, concurrent queue creation and batch limits. Validation: 61 unit tests and Checkstyle pass; ordinary-topic component benchmark at 5k commits/s passes all nine runs.
f1amingo
force-pushed
the
enhancement/async-batch-consumer-offset-persist
branch
from
November 26, 2026 16:09
9e14011 to
c050b29
Compare
lizhimins
approved these changes
Nov 27, 2026
lizhimins
left a comment
Member
There was a problem hiding this comment.
LGTM. The deduplicated async batch design is clean: clear writeLock -> pendingLock ordering, mark-before-read so concurrent updates requeue, atomic WriteBatch retry on failure, and delete/batch serialized by writeLock. The shared-RocksDB shutdown ordering fix is a real improvement, tests are thorough, and CI is green.
A few non-blocking follow-ups worth tracking separately:
- stop() failure/timeout path: in shared-RocksDB mode the shared store can still be closed by topic/subscription stop() while the offset worker may still be alive; AbstractRocksDBStorage.batchPut has no hold() guard.
- Persisted kvDataVersion now lags persisted offsets (version only written on persist/stop). Consider stamping the version into the same WriteBatch as V2 does.
- The pending set is unbounded and each tick flushes a single batch; consider multi-batch draining and a pending-size metric.
Thanks for the contribution!
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.
Which Issue(s) This PR Fixes
Brief Description
persist()andstop(); deleting an offset cancels its pending write.flushWALChecked()so the offset barrier can detect WAL flush failures.How Did You Test This Change?
RocksDBConsumerOffsetManagerLmqPersistTest(32 cases) and shared-RocksDB shutdown cases inBrokerShutdownTest; both pass together withRocksDBConfigManagerTest.