This is an automated email from the ASF dual-hosted git repository.
hulk pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/kvrocks.git
The following commit(s) were added to refs/heads/unstable by this push:
new 77b01b6fe fix(replication): fix _getack send check (#3248)
77b01b6fe is described below
commit 77b01b6fed23d2763500756d74d9e6e31deb932d
Author: zhixinwen <[email protected]>
AuthorDate: Thu Nov 6 00:32:10 2025 -0800
fix(replication): fix _getack send check (#3248)
The original check was wrong. It should use the end of a write batch
instead of the beginning sequence.
---------
Co-authored-by: hulk <[email protected]>
---
src/cluster/replication.cc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/cluster/replication.cc b/src/cluster/replication.cc
index 21f484208..aaeab93ae 100644
--- a/src/cluster/replication.cc
+++ b/src/cluster/replication.cc
@@ -214,7 +214,9 @@ void FeedSlaveThread::loop() {
// kMaxDelayUpdates than latest sequence.
if (is_first_repl_batch || batches_bulk.size() >= max_delay_bytes_ ||
updates_in_batches >= max_delay_updates_ ||
srv_->storage->LatestSeqNumber() - batch.sequence <=
max_delay_updates_) {
- if (shouldSendGetAck(batch.sequence)) {
+ // get the last sequence number of the batch, because WAIT uses
+ // the last sequence number to wake up the connection.
+ if (shouldSendGetAck(batch.sequence + batch.writeBatchPtr->Count() - 1))
{
batches_bulk += redis::BulkString("_getack");
}