This is an automated email from the ASF dual-hosted git repository.

twice pushed a commit to branch 2.14
in repository https://gitbox.apache.org/repos/asf/kvrocks.git

commit aa0ce38893ece66d7ba6685525fb64e33f22aff6
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");
       }
 

Reply via email to