You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by sa...@apache.org on 2024/03/14 03:38:31 UTC

(ozone) branch HDDS-7593 updated: HDDS-10497. [hsync] Refresh block token immediately if block token expires. (#6371)

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

sammichen pushed a commit to branch HDDS-7593
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/HDDS-7593 by this push:
     new dd5b49bbeb HDDS-10497. [hsync] Refresh block token immediately if block token expires. (#6371)
dd5b49bbeb is described below

commit dd5b49bbeb972140c5d5da1ae4d4af162799f042
Author: Wei-Chiu Chuang <we...@apache.org>
AuthorDate: Wed Mar 13 20:38:26 2024 -0700

    HDDS-10497. [hsync] Refresh block token immediately if block token expires. (#6371)
---
 .../apache/hadoop/hdds/scm/storage/ContainerProtocolCalls.java   | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/storage/ContainerProtocolCalls.java b/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/storage/ContainerProtocolCalls.java
index c85405566c..58bb326eb0 100644
--- a/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/storage/ContainerProtocolCalls.java
+++ b/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/storage/ContainerProtocolCalls.java
@@ -76,6 +76,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import static java.util.Collections.singletonList;
+import static org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.Result.BLOCK_TOKEN_VERIFICATION_FAILED;
 
 /**
  * Implementation of all container protocol calls performed by Container
@@ -146,6 +147,14 @@ public final class ContainerProtocolCalls  {
       try {
         return op.apply(d);
       } catch (IOException e) {
+        if (e instanceof StorageContainerException) {
+          StorageContainerException sce = (StorageContainerException)e;
+          // Block token expired. There's no point retrying other DN.
+          // Throw the exception to request a new block token right away.
+          if (sce.getResult() == BLOCK_TOKEN_VERIFICATION_FAILED) {
+            throw e;
+          }
+        }
         excluded.add(d);
         if (excluded.size() < pipeline.size()) {
           LOG.warn(toErrorMessage.apply(d)


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