Repository navigation
[ISSUE #11489] Improve POP KV ACK and ChangeInvisibleTime performance with group commit - #11490
Closed
qianye1001 wants to merge 6 commits into
Closed
qianye1001 wants to merge 6 commits into
qianye1001 wants to merge 6 commits into
Conversation
…rmance with group commit
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #11490 +/- ##
=============================================
+ Coverage 49.78% 49.96% +0.17%
- Complexity 14391 14512 +121
=============================================
Files 1391 1393 +2
Lines 103350 103589 +239
Branches 13518 13554 +36
=============================================
+ Hits 51455 51756 +301
+ Misses 45680 45603 -77
- Partials 6215 6230 +15 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
With POP KV enabled, ACK and ChangeInvisibleTime can occupy the shared ACK executor while waiting for synchronous RocksDB WAL writes or write stalls. This queues persistence on one
ServiceThreadand completes requests asynchronously after the required writes succeed.The writer handles explicit POP, ACK, CHANGE, cache-transfer and cache-clear tasks alongside storage writes. Consecutive tasks of the same type share an ordered
WriteBatch; a type change commits the preceding batch before examining cache state. Transfer and clear tasks run individually. This keeps task ordering direct, without a generic state-update API or per-message dependency tracking. Mixed operation types can therefore produce smaller batches than a dependency-based scheduler.Cache selection, persistence and removal now execute on that same writer. If cache transfer runs first, CHANGE replaces the persisted old checkpoint successfully. If CHANGE runs first, transfer cannot select and restore the old checkpoint. CHANGE's put/delete operations are atomic, and cache removal follows successful persistence. Failed transfers retain staged records; subsequent CHANGE/ACK also deletes an old disk key whose preceding write outcome was uncertain. A cache-hit ACK still avoids a disk write.
The queue is unbounded. Each batch has a 128-request limit and a 1 MiB target, keeping larger atomic requests intact. WAL and
sync=trueare retained. Responses run on a separate completion pool (default 4 workers, configurable withpopConsumerKVCompletionThreadPoolNums), one task per request. Shutdown drains accepted writes and callbacks before closing RocksDB. Synchronous compatibility calls use private Futures so completion workers can safely submit and wait for another write.ACK, batch ACK and CHANGE wait asynchronously for persistence; POP KV CHANGE no longer blocks the request executor when the legacy async flags are disabled. POP persistence failures produce an error response and release message buffers. Background persistence uses the same writer, and revive advances its scan cursor only after persistence succeeds. The cache-transfer race is covered here; the external RocksDB-expiry revive flow remains outside the state writer.
How Did You Test This Change?
Using JDK 21 with the protocol submodule initialized:
101 tests, 0 failures, 0 errors, 1 pre-existing skipped test. Checkstyle and SpotBugs passed.
Coverage includes both orderings of cache transfer versus CHANGE, transfer versus ACK, failed/uncertain transfers, cached-checkpoint preservation, consecutive CHANGE and ACK batching, queued POP → CHANGE → ACK ordering, native RocksDB persistence/reopen checks, size limits, shutdown draining, callback concurrency and reentrant writes, and asynchronous processor response timing/errors.
JaCoCo 0.8.5 is skipped because it does not support JDK 21. End-to-end throughput and crash-recovery behavior have not been benchmarked by this validation.