[Enhancement] Improve ACK and ChangeInvisibleTime performance with POP KV group commit
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
- #11490 di @qianye1001 — chiusa senza merge
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 30/100
Direzione di ricerca
Start with PopConsumerRocksdbStore.deleteRecords(), changeInvisibilityDuration(), and the POP KV cache flush and maintenance paths described in the issue. Trace how these writes share the database and how CHANGE orders cache transfer, persistence, and removal; then identify the existing ServiceThread and response Future patterns. Done means ACK and CHANGE responses follow persistence success or failure, batching preserves ordering and durability, and shutdown drains accepted work.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Before Creating the Enhancement Request
- I have confirmed that this should be classified as an enhancement rather than a bug/feature.
Summary
With popConsumerKVServiceEnable=true, ACK and ChangeInvisibleTime can spend substantial time waiting inside synchronous RocksDB writes. Both request types share the Broker ACK executor, so bursts of invisible-time changes can occupy its workers and delay otherwise unrelated ACK requests.
Improve ACK/CHANGE throughput and tail latency by batching POP KV mutations across requests and completing responses asynchronously after persistence, while keeping synchronous WAL durability.
Motivation
The current POP KV path has the following behavior:
- An ACK that misses the POP checkpoint cache calls
PopConsumerRocksdbStore.deleteRecords()directly. Although the service method is namedackAsync(), the RocksDB write happens before the method returns. changeInvisibilityDuration()writes the replacement checkpoint synchronously and, when necessary, deletes the old checkpoint in another synchronous write. Even when the old checkpoint is cached, the replacement checkpoint still requires a storage write.- Both write paths use
WriteOptions.sync=trueand WAL enabled. The request worker remains occupied untildb.write()returns; WAL synchronization and RocksDB write stalls can therefore consume the shared ACK executor's capacity. - POP checkpoint writes, cache flushing and expired-checkpoint/revive maintenance also write to the same database. Cache transfer must be ordered with CHANGE across selection, persistence and cache removal: otherwise a delayed flush can restore an old checkpoint after CHANGE has persisted its replacement and deleted the old key.
Bursty renewals, client-disconnection cleanup or other batches of invisible-time changes can consequently increase ACK queueing latency and reduce consumption throughput. Increasing the request thread count does not remove the synchronous storage work or aggregate mutations at the Broker layer. RocksDB can already group concurrent writers internally, but callers still wait in its synchronous write API.
A workload for evaluating this problem is a small ACK executor serving a steady ACK stream together with periodic CHANGE bursts. Use enablePopBufferMerge=false to exercise storage ACKs directly, and repeat with the cache enabled to cover renewal writes and cache misses. Measure ACK/CHANGE latency, executor queueing, completed requests and WAL synchronization activity. This issue does not claim a measured end-to-end throughput improvement.
Describe the Solution You'd Like
- Introduce a shared, unbounded POP KV mutation queue and one batch writer based on RocketMQ ServiceThread. Drain currently available requests into a
WriteBatchwithout deliberately delaying low-load requests to collect a batch. - Return real persistence Futures to ACK and CHANGE callers. Send success only after the required write completes; propagate write failures and submissions rejected during shutdown to the response.
- Make the POP KV CHANGE response asynchronous independently of the legacy
appendCkAsync/appendAckAsyncsettings. - Route checkpoint creation and background checkpoint maintenance through the same writer. Serialize cache transfer and CHANGE state transitions on the writer, including cache inspection and post-commit removal, so either ordering completes without restoring the old checkpoint. Preserve operation order, cached-checkpoint safety, same-key replacement behavior and scan-cursor advancement after successful persistence.
- Preserve
sync=trueand WAL enabled, limit individual batch size, and drain accepted writes and completion callbacks before closing the database.
Describe Alternatives You've Considered
- More ACK workers: allows more synchronous callers to wait, but does not address request-thread occupancy or Broker-level batching.
- One background write per request: releases request workers, but serializing individual small writes without batching can reduce throughput.
sync=false: changes the durability guarantee and still does not provide a callback-based nonblocking write API.- An ACK worker elected as batch leader: can bound blocked ACK workers to one; a dedicated writer instead isolates the request pool from storage stalls and also serves background producers.
Additional Context
Inspected on develop at 8ab8191478115d5e2f5344127fba704267fdb659 (project version 5.5.1, RocksDB JNI 8.4.4).
Related: #10489 proposes a new batch CHANGE protocol across Proxy/Broker. This issue concerns Broker-side aggregation and asynchronous persistence for existing ACK/CHANGE requests, without requiring a new client or wire protocol.
- Lingua principale
- Java
- Stelle
- 22.7k
- Fork
- 12k
- Merge medio
- 4g 20h
- PR unite (30g)
- 11
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/rocketmq
-
[Bug] RemotingHelper.connect swaps the socket send and receive buffer configurationForse già presa @amalsaidov l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
CompressionType.of fails under the Turkish localeForse già presa @sharanggupta l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno
-
[rocketmq-client-python] TransactionMQProducer allocates an unused producer during initializationAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug] notifyMasterOnline aborts the long-polling wake-up with a NullPointerException when an arrival drains a bucket firstForse già presa @iloveeyjafjalla l’ha presa 29 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
apache/rocketmq#11441 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Enhancement] FilterFactory duplicate-registration and unregister semantics lack testsForse già presa @chennaji9 l’ha presa 34 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
apache/rocketmq#11340 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di apache/rocketmq
Issue simili
-
bug emitter:client:csharp
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
microsoft/typespec#12572 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
GCC 15.2: -Wcast-qual warning - cast discards const qualifier from pointer target type (H5trace.c)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
I maintainer di solito rispondono entro 1 giorno
-
needs-area-label
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
area/ai area/backend component/zeebe kind/task
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
spAnser/reacharound#38 ·