From 934278a7a0fb2aa556a044baeaf60a0b6314db42 Mon Sep 17 00:00:00 2001 From: abyswang Date: Wed, 29 Mar 2023 14:44:35 +0800 Subject: [PATCH 1/2] fix l5 update bug --- .../org/apache/hadoop/fs/CosNativeFileSystemStore.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/org/apache/hadoop/fs/CosNativeFileSystemStore.java b/src/main/java/org/apache/hadoop/fs/CosNativeFileSystemStore.java index b25484cd..68ee7746 100644 --- a/src/main/java/org/apache/hadoop/fs/CosNativeFileSystemStore.java +++ b/src/main/java/org/apache/hadoop/fs/CosNativeFileSystemStore.java @@ -1880,6 +1880,15 @@ private Object callCOSClientWithRetry(X request) throws CosServiceException, throw cse; } } catch (Exception e) { + if (useL5Id) { + if (l5ErrorCodeRetryIndex >= this.l5UpdateMaxRetryTimes) { + // L5上报,进行重试 + l5EndpointResolver.updateRouteResult(-1); + l5ErrorCodeRetryIndex = 1; + } else { + l5ErrorCodeRetryIndex = l5ErrorCodeRetryIndex + 1; + } + } throw new IOException(e); } } From 5e0d2e92bef8a14aca09490d37b80c070fde4003 Mon Sep 17 00:00:00 2001 From: abyswang Date: Wed, 29 Mar 2023 15:52:51 +0800 Subject: [PATCH 2/2] fix l5 update bug --- .../java/org/apache/hadoop/fs/CosNativeFileSystemStore.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/apache/hadoop/fs/CosNativeFileSystemStore.java b/src/main/java/org/apache/hadoop/fs/CosNativeFileSystemStore.java index 68ee7746..6556c7b6 100644 --- a/src/main/java/org/apache/hadoop/fs/CosNativeFileSystemStore.java +++ b/src/main/java/org/apache/hadoop/fs/CosNativeFileSystemStore.java @@ -1889,7 +1889,11 @@ private Object callCOSClientWithRetry(X request) throws CosServiceException, l5ErrorCodeRetryIndex = l5ErrorCodeRetryIndex + 1; } } - throw new IOException(e); + if (retryIndex > this.maxRetryTimes) { + throw new IOException(e); + } else { + ++retryIndex; + } } } }