From ab0f35736779575edcf4d23609c1a2f9c55d055f Mon Sep 17 00:00:00 2001 From: Iraklis Psaroudakis Date: Mon, 27 Jun 2022 15:54:38 +0300 Subject: [PATCH] Temporary logging --- .../cluster/coordination/Coordinator.java | 10 ++++++++++ .../discovery/FileBasedSeedHostsProvider.java | 2 +- .../discovery/SettingsBasedSeedHostsProvider.java | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/cluster/coordination/Coordinator.java b/server/src/main/java/org/elasticsearch/cluster/coordination/Coordinator.java index 332186b553882..d77c77a66cb8b 100644 --- a/server/src/main/java/org/elasticsearch/cluster/coordination/Coordinator.java +++ b/server/src/main/java/org/elasticsearch/cluster/coordination/Coordinator.java @@ -772,6 +772,16 @@ private void checkSingleNodeCluster() { // Ignore case where the seed hosts are from the default seed addresses Set defaultAddresses = Set.copyOf(transportService.getDefaultSeedAddresses()); + + // TODO: temporary. Remove section before merging. + logger.info("The default addresses are: {}.", defaultAddresses); + logger.info("Discovery seed hosts setting exists: {}.", DISCOVERY_SEED_HOSTS_SETTING.exists(settings)); + logger.info( + "The address of this local node is: [{}]. The addresses of the last resolved discovery seed hosts are: {}.", + this.getLocalNode().getAddress(), + lastResolvedAddresses + ); + if (lastResolvedAddresses.stream().allMatch(t -> defaultAddresses.contains(t.toString()))) { return; } diff --git a/server/src/main/java/org/elasticsearch/discovery/FileBasedSeedHostsProvider.java b/server/src/main/java/org/elasticsearch/discovery/FileBasedSeedHostsProvider.java index 0c80a53bfd8f4..b3a9f99702e16 100644 --- a/server/src/main/java/org/elasticsearch/discovery/FileBasedSeedHostsProvider.java +++ b/server/src/main/java/org/elasticsearch/discovery/FileBasedSeedHostsProvider.java @@ -63,7 +63,7 @@ private List getHostsList() { @Override public List getSeedAddresses(HostsResolver hostsResolver) { final List transportAddresses = hostsResolver.resolveHosts(getHostsList()); - logger.debug("seed addresses: {}", transportAddresses); + logger.info("seed addresses: {}", transportAddresses); return transportAddresses; } } diff --git a/server/src/main/java/org/elasticsearch/discovery/SettingsBasedSeedHostsProvider.java b/server/src/main/java/org/elasticsearch/discovery/SettingsBasedSeedHostsProvider.java index eb0553263b19b..266dbb847017a 100644 --- a/server/src/main/java/org/elasticsearch/discovery/SettingsBasedSeedHostsProvider.java +++ b/server/src/main/java/org/elasticsearch/discovery/SettingsBasedSeedHostsProvider.java @@ -50,7 +50,7 @@ public SettingsBasedSeedHostsProvider(Settings settings, TransportService transp configuredHosts = transportService.getDefaultSeedAddresses(); } - logger.debug("using initial hosts {}", configuredHosts); + logger.info("using initial hosts {}", configuredHosts); } @Override