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 4f1b4fb3496 recycle only in leader
4f1b4fb3496 is described below
commit 4f1b4fb34968bde16e41fffd0da7c1dfd9fbe6d3
Author: Tian Jiang <[email protected]>
AuthorDate: Mon May 22 09:19:40 2023 +0800
recycle only in leader
---
.../java/org/apache/iotdb/consensus/natraft/protocol/RaftMember.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/consensus/src/main/java/org/apache/iotdb/consensus/natraft/protocol/RaftMember.java
b/consensus/src/main/java/org/apache/iotdb/consensus/natraft/protocol/RaftMember.java
index 1b40503a5c3..03c45a917f0 100644
---
a/consensus/src/main/java/org/apache/iotdb/consensus/natraft/protocol/RaftMember.java
+++
b/consensus/src/main/java/org/apache/iotdb/consensus/natraft/protocol/RaftMember.java
@@ -256,7 +256,7 @@ public class RaftMember {
}
public void recycleEntry(Entry entry) {
- if (entry instanceof RequestEntry) {
+ if (isLeader() && entry instanceof RequestEntry) {
requestEntryAllocator.recycle(((RequestEntry) entry));
}
}