Skip to content

Conversation

@sodonnel
Copy link
Contributor

Description of PR

When an IPCLoggerChannel is created (which is used to read from and write to the Journal nodes) it also creates a metrics object. When the namenodes failover, the IPC loggers are all closed and reopened in read mode on the new SBNN or the read mode is closed on the SBNN and re-opened in write mode. The closing frees the resources and discards the original IPCLoggerChannel object and causes a new one to be created by the caller.

If a Journal node was down and added back to the cluster with the same hostname, but a different IP, when the failover happens, you end up with 4 metrics objects for the JNs:

  1. For for each of the original 3 IPs
  2. One for the new IP

The old stale metric will remain forever and will no longer be updated, leading to confusing results in any tools that use the metrics for monitoring.

This change, ensures we un-register the metrics when the logger channel is closed and a new metrics object gets created when the new channel is created.

For info, the logger metrics look like:

{
   "name" : "Hadoop:service=NameNode,name=IPCLoggerChannel-192.168.32.8-8485",
    "modelerType" : "IPCLoggerChannel-192.168.32.8-8485",
    "tag.Context" : "dfs",
    "tag.IsOutOfSync" : "false",
    "tag.Hostname" : "957e3e66f10b",
    "QueuedEditsSize" : 0,
    "LagTimeMillis" : 0,
    "CurrentLagTxns" : 0
  }

Note the name includes the IP, rather than the hostname.

How was this patch tested?

I have added a small test to prove this, but also reproduced the original issue on a docker cluster and validated it is resolved with this change in place.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 12m 8s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 44m 5s trunk passed
+1 💚 compile 1m 16s trunk passed with JDK Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu120.04
+1 💚 compile 1m 12s trunk passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05
+1 💚 checkstyle 1m 8s trunk passed
+1 💚 mvnsite 1m 22s trunk passed
-1 ❌ javadoc 1m 5s /branch-javadoc-hadoop-hdfs-project_hadoop-hdfs-jdkUbuntu-11.0.20.1+1-post-Ubuntu-0ubuntu120.04.txt hadoop-hdfs in trunk failed with JDK Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu120.04.
+1 💚 javadoc 1m 36s trunk passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05
+1 💚 spotbugs 3m 12s trunk passed
+1 💚 shadedclient 34m 19s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 1m 10s the patch passed
+1 💚 compile 1m 13s the patch passed with JDK Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu120.04
+1 💚 javac 1m 13s the patch passed
+1 💚 compile 1m 3s the patch passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05
+1 💚 javac 1m 3s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 57s hadoop-hdfs-project/hadoop-hdfs: The patch generated 0 new + 9 unchanged - 3 fixed = 9 total (was 12)
+1 💚 mvnsite 1m 12s the patch passed
-1 ❌ javadoc 0m 51s /patch-javadoc-hadoop-hdfs-project_hadoop-hdfs-jdkUbuntu-11.0.20.1+1-post-Ubuntu-0ubuntu120.04.txt hadoop-hdfs in the patch failed with JDK Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu120.04.
+1 💚 javadoc 1m 27s the patch passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05
+1 💚 spotbugs 3m 10s the patch passed
+1 💚 shadedclient 34m 14s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 209m 29s hadoop-hdfs in the patch passed.
+1 💚 asflicense 0m 42s The patch does not generate ASF License warnings.
356m 44s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6217/1/artifact/out/Dockerfile
GITHUB PR #6217
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 30c2cb3a0a2f 5.15.0-86-generic #96-Ubuntu SMP Wed Sep 20 08:23:49 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 2766261
Default Java Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6217/1/testReport/
Max. process+thread count 3555 (vs. ulimit of 5500)
modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6217/1/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@arp7
Copy link
Contributor

arp7 commented Oct 24, 2023

LGTM. +1 binding. Thanks for fixing this Stephen.

@arp7 arp7 self-requested a review October 24, 2023 15:13
@sodonnel sodonnel merged commit 882f08b into apache:trunk Oct 24, 2023
@sodonnel
Copy link
Contributor Author

Merged to trunk. Thanks for the review @arp7

asfgit pushed a commit that referenced this pull request Oct 24, 2023
jiajunmao pushed a commit to jiajunmao/hadoop-MLEC that referenced this pull request Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants