You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ji...@apache.org on 2023/05/10 08:17:35 UTC

[iotdb] branch native_raft updated: avoid ByteBufferConsensusRequest being modified

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

jiangtian pushed a commit to branch native_raft
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/native_raft by this push:
     new 165937ea19 avoid ByteBufferConsensusRequest being modified
165937ea19 is described below

commit 165937ea196ca0b00dcb91898c12883b99e58e51
Author: Tian Jiang <jt...@163.com>
AuthorDate: Wed May 10 16:20:24 2023 +0800

    avoid ByteBufferConsensusRequest being modified
---
 .../iotdb/consensus/common/request/ByteBufferConsensusRequest.java      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/consensus/src/main/java/org/apache/iotdb/consensus/common/request/ByteBufferConsensusRequest.java b/consensus/src/main/java/org/apache/iotdb/consensus/common/request/ByteBufferConsensusRequest.java
index b05a35a561..48ad1e0d1d 100644
--- a/consensus/src/main/java/org/apache/iotdb/consensus/common/request/ByteBufferConsensusRequest.java
+++ b/consensus/src/main/java/org/apache/iotdb/consensus/common/request/ByteBufferConsensusRequest.java
@@ -37,7 +37,7 @@ public class ByteBufferConsensusRequest implements IConsensusRequest {
 
   @Override
   public ByteBuffer serializeToByteBuffer() {
-    return byteBuffer;
+    return byteBuffer.slice();
   }
 
   @Override