You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ratis.apache.org by sz...@apache.org on 2025/01/22 16:38:05 UTC

(ratis) branch master updated: RATIS-2240. updatePurgeIndex doesn't need to hold RaftLogBase.writeLock (#1214)

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

szetszwo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ratis.git


The following commit(s) were added to refs/heads/master by this push:
     new 345641fb4 RATIS-2240. updatePurgeIndex doesn't need to hold RaftLogBase.writeLock (#1214)
345641fb4 is described below

commit 345641fb4ce434197981982b08f8d78f412753fb
Author: William Song <48...@users.noreply.github.com>
AuthorDate: Thu Jan 23 00:38:00 2025 +0800

    RATIS-2240. updatePurgeIndex doesn't need to hold RaftLogBase.writeLock (#1214)
---
 .../src/main/java/org/apache/ratis/server/raftlog/RaftLogBase.java  | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/ratis-server/src/main/java/org/apache/ratis/server/raftlog/RaftLogBase.java b/ratis-server/src/main/java/org/apache/ratis/server/raftlog/RaftLogBase.java
index d6314bc13..05e45e97a 100644
--- a/ratis-server/src/main/java/org/apache/ratis/server/raftlog/RaftLogBase.java
+++ b/ratis-server/src/main/java/org/apache/ratis/server/raftlog/RaftLogBase.java
@@ -144,10 +144,8 @@ public abstract class RaftLogBase implements RaftLog {
   }
 
   protected void updatePurgeIndex(Long purged) {
-    try (AutoCloseableLock writeLock = writeLock()) {
-      if (purged != null) {
-        purgeIndex.updateToMax(purged, infoIndexChange);
-      }
+    if (purged != null) {
+      purgeIndex.updateToMax(purged, infoIndexChange);
     }
   }