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

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


The following commit(s) were added to refs/heads/master by this push:
     new 3ba954e3f3d HDDS-16758. Check local-lease metrics on the serving OM 
(#11447)
3ba954e3f3d is described below

commit 3ba954e3f3df2ce060189e051a558500cd5d48c1
Author: KUAN-HAO HUANG <[email protected]>
AuthorDate: Fri Oct 9 01:41:05 2026 +0800

    HDDS-16758. Check local-lease metrics on the serving OM (#11447)
---
 .../TestOzoneManagerHAFollowerReadWithAllRunning.java | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAFollowerReadWithAllRunning.java
 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAFollowerReadWithAllRunning.java
index e14fd250205..187fc9ae767 100644
--- 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAFollowerReadWithAllRunning.java
+++ 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAFollowerReadWithAllRunning.java
@@ -43,7 +43,9 @@
 import java.security.PrivilegedExceptionAction;
 import java.time.Instant;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Stream;
 import org.apache.commons.lang3.RandomStringUtils;
 import org.apache.hadoop.hdds.conf.OzoneConfiguration;
@@ -643,16 +645,19 @@ void testClientWithLocalLeaseEnabled() throws Exception {
       assertNotNull(followerReadFailoverProxyProvider);
       
assertTrue(followerReadFailoverProxyProvider.isOmServiceSupportsFollowerRead());
 
-      String currentOMNodeId = 
followerReadFailoverProxyProvider.getCurrentProxy().getNodeId();
-      OzoneManager ozoneManager = 
getCluster().getOzoneManager(currentOMNodeId);
-      assertNotNull(ozoneManager);
-      assertEquals(currentOMNodeId, ozoneManager.getOMNodeId());
-
-      long previousLocalLeaseSuccess = 
ozoneManager.getMetrics().getNumFollowerReadLocalLeaseSuccess();
+      Map<String, Long> previousLocalLeaseSuccess = new HashMap<>();
+      for (OzoneManager om : getCluster().getOzoneManagersList()) {
+        previousLocalLeaseSuccess.put(om.getOMNodeId(), 
om.getMetrics().getNumFollowerReadLocalLeaseSuccess());
+      }
 
       objectStore.listVolumes("");
+      OMProxyInfo<OzoneManagerProtocolPB> lastProxy =
+          (OMProxyInfo<OzoneManagerProtocolPB>) 
followerReadFailoverProxyProvider.getLastProxy();
+      assertNotNull(lastProxy);
+      OzoneManager ozoneManager = 
getCluster().getOzoneManager(lastProxy.getNodeId());
+      assertNotNull(ozoneManager);
       long currentLocalLeaseSuccess = 
ozoneManager.getMetrics().getNumFollowerReadLocalLeaseSuccess();
-      
assertThat(currentLocalLeaseSuccess).isGreaterThan(previousLocalLeaseSuccess);
+      
assertThat(currentLocalLeaseSuccess).isGreaterThan(previousLocalLeaseSuccess.get(lastProxy.getNodeId()));
     } finally {
       IOUtils.closeQuietly(ozoneClient);
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to