You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/12/01 07:37:38 UTC

[GitHub] [ozone] bshashikant commented on a change in pull request #2704: HDDS-3227. Ensure eviction of stateMachineData from cache only when both followers catch up

bshashikant commented on a change in pull request #2704:
URL: https://github.com/apache/ozone/pull/2704#discussion_r759922175



##########
File path: hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/ContainerStateMachine.java
##########
@@ -736,23 +744,48 @@ public void notifyTermIndexUpdated(long term, long index) {
     return f;
   }
 
+  // Removes the stateMachine data from cache once both followers catch up
+  // to the particular index.
+  private void removeStateMachineDataIfNeeded(long index) {
+    if (waitOnBothFollowers) {
+      LOG.info("Removing data corresponding to log index {} from cache",
+          index);
+      try {
+        RaftServer.Division division = ratisServer.getServer().getDivision(gid);
+        if (division.getInfo().isLeader() && Arrays
+            .stream(division.getInfo().getFollowerNextIndices())
+            .allMatch(i -> i >= index)) {

Review comment:
       Agreed. Addressed in the latest patch.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org