You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@amoro.apache.org by ji...@apache.org on 2026/01/20 06:02:22 UTC

(amoro) branch master updated: [Hotfix] Block followership forever for NoopHighAvailabilityContainer (#4052)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new c69eff450 [Hotfix] Block followership forever for NoopHighAvailabilityContainer (#4052)
c69eff450 is described below

commit c69eff45031ad31cd5efaf495b11bbaf0959414d
Author: ZhouJinsong <zh...@163.com>
AuthorDate: Tue Jan 20 14:02:19 2026 +0800

    [Hotfix] Block followership forever for NoopHighAvailabilityContainer (#4052)
    
    * Block followership for NoopHighAvailabilityContainer
    
    * Fix a typo issue
    
    * Fix a typo issue
---
 .../amoro/server/ha/NoopHighAvailabilityContainer.java     | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/amoro-ams/src/main/java/org/apache/amoro/server/ha/NoopHighAvailabilityContainer.java b/amoro-ams/src/main/java/org/apache/amoro/server/ha/NoopHighAvailabilityContainer.java
index e8bef7d9c..7018a8d15 100644
--- a/amoro-ams/src/main/java/org/apache/amoro/server/ha/NoopHighAvailabilityContainer.java
+++ b/amoro-ams/src/main/java/org/apache/amoro/server/ha/NoopHighAvailabilityContainer.java
@@ -21,25 +21,29 @@ package org.apache.amoro.server.ha;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.concurrent.CountDownLatch;
+
 /** No-op HA container that never blocks and performs no leader election. */
 public class NoopHighAvailabilityContainer implements HighAvailabilityContainer {
   private static final Logger LOG = LoggerFactory.getLogger(NoopHighAvailabilityContainer.class);
+  private final CountDownLatch followerLatch = new CountDownLatch(1);
 
   @Override
   /** Returns immediately without blocking. */
   public void waitLeaderShip() {
-    LOG.info("Noop HA: waitLeaderShip returns immediately");
+    LOG.info("Noop HA: waiting leadership returns immediately");
   }
 
   @Override
-  /** Returns immediately without blocking. */
-  public void waitFollowerShip() {
-    LOG.info("Noop HA: waitFollowerShip returns immediately");
+  /** Block followership forever for noop. */
+  public void waitFollowerShip() throws InterruptedException {
+    followerLatch.await();
+    LOG.warn("Noop HA: waiting followership should not return");
   }
 
   @Override
   /** No-op close operation. */
   public void close() {
-    LOG.info("Noop HA: close");
+    LOG.info("Noop HA: closed");
   }
 }