From 978414fdbfaf440289caadc084d374abb4d46163 Mon Sep 17 00:00:00 2001 From: Yan Zhao Date: Wed, 21 Feb 2024 02:14:03 +0800 Subject: [PATCH] Add `InetAddress.getLocalHost().getCanonicalHostName()` for MyRack. (#4213) --- .../client/TestRegionAwareEnsemblePlacementPolicy.java | 1 + 1 file changed, 1 insertion(+) diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestRegionAwareEnsemblePlacementPolicy.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestRegionAwareEnsemblePlacementPolicy.java index e254b76f034..4f5bf086215 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestRegionAwareEnsemblePlacementPolicy.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestRegionAwareEnsemblePlacementPolicy.java @@ -80,6 +80,7 @@ public class TestRegionAwareEnsemblePlacementPolicy extends TestCase { static void updateMyRack(String rack) throws Exception { StaticDNSResolver.addNodeToRack(InetAddress.getLocalHost().getHostAddress(), rack); StaticDNSResolver.addNodeToRack(InetAddress.getLocalHost().getHostName(), rack); + StaticDNSResolver.addNodeToRack(InetAddress.getLocalHost().getCanonicalHostName(), rack); BookieSocketAddress bookieAddress = new BookieSocketAddress( InetAddress.getLocalHost().getHostAddress(), 0); StaticDNSResolver.addNodeToRack(bookieAddress.getSocketAddress().getHostName(), rack);