You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kvrocks.apache.org by tw...@apache.org on 2022/11/03 12:35:48 UTC

[incubator-kvrocks] branch unstable updated: Fix dangling reference in ReplicationThread::ParseWriteBatch (#1067)

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

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


The following commit(s) were added to refs/heads/unstable by this push:
     new 62c7b51f Fix dangling reference in ReplicationThread::ParseWriteBatch (#1067)
62c7b51f is described below

commit 62c7b51faf0ec332dca1d65080597c270272d84a
Author: Twice <tw...@gmail.com>
AuthorDate: Thu Nov 3 20:35:42 2022 +0800

    Fix dangling reference in ReplicationThread::ParseWriteBatch (#1067)
---
 src/cluster/replication.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/cluster/replication.cc b/src/cluster/replication.cc
index 5e20aa9a..25abf3e8 100644
--- a/src/cluster/replication.cc
+++ b/src/cluster/replication.cc
@@ -912,7 +912,8 @@ rocksdb::Status ReplicationThread::ParseWriteBatch(const std::string &batch_stri
       }
       break;
     case kBatchTypeStream:
-      InternalKey ikey(write_batch_handler.Key(), storage_->IsSlotIdEncoded());
+      auto key = write_batch_handler.Key();
+      InternalKey ikey(key, storage_->IsSlotIdEncoded());
       Slice entry_id = ikey.GetSubKey();
       Redis::StreamEntryID id;
       GetFixed64(&entry_id, &id.ms);