You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When NameNode is configured with HA and NameNode 1 is restarting and loading fsimage, accessing WebHDFS does not trigger client-side failover.
During fsimage loading after NameNode restart in HA configuration, WebHDFS returns RetriableException instead of StandbyException. Because of this, the client-side failover does not work and the client keeps retrying the same NameNode. Eventually the client fails because it cannot find the active NameNode.
$ hdfs dfs -ls swebhdfs://blue
2023-07-14 12:23:55,890 INFO web.WebHdfsFileSystem: Retrying connect to namenode: blue-nn1.host/10.10.10.10:9470. Already retried 0 time(s); retry policy is org.apache.hadoop.io.retry.RetryPolicies$FailoverOnNetworkExceptionRetry@95e33cc, delay 0ms.
2023-07-14 12:23:55,929 INFO web.WebHdfsFileSystem: Retrying connect to namenode: blue-nn1.host/10.10.10.10:9470. Already retried 1 time(s); retry policy is org.apache.hadoop.io.retry.RetryPolicies$FailoverOnNetworkExceptionRetry@95e33cc, delay 731ms.
2023-07-14 12:23:56,697 INFO web.WebHdfsFileSystem: Retrying connect to namenode: blue-nn1.host/10.10.10.10:9470. Already retried 2 time(s); retry policy is org.apache.hadoop.io.retry.RetryPolicies$FailoverOnNetworkExceptionRetry@95e33cc, delay 1475ms.
2023-07-14 12:23:58,207 INFO web.WebHdfsFileSystem: Retrying connect to namenode: blue-nn1.host/10.10.10.10:9470. Already retried 3 time(s); retry policy is org.apache.hadoop.io.retry.RetryPolicies$FailoverOnNetworkExceptionRetry@95e33cc, delay 5061ms.
2023-07-14 12:24:03,304 INFO web.WebHdfsFileSystem: Retrying connect to namenode: blue-nn1.host/10.10.10.10:9470. Already retried 4 time(s); retry policy is org.apache.hadoop.io.retry.RetryPolicies$FailoverOnNetworkExceptionRetry@95e33cc, delay 7898ms.
2023-07-14 12:24:11,235 INFO web.WebHdfsFileSystem: Retrying connect to namenode: blue-nn1.host/10.10.10.10:9470. Already retried 5 time(s); retry policy is org.apache.hadoop.io.retry.RetryPolicies$FailoverOnNetworkExceptionRetry@95e33cc, delay 18847ms.
2023-07-14 12:24:30,117 INFO web.WebHdfsFileSystem: Retrying connect to namenode: blue-nn1.host/10.10.10.10:9470. Already retried 6 time(s); retry policy is org.apache.hadoop.io.retry.RetryPolicies$FailoverOnNetworkExceptionRetry@95e33cc, delay 20826ms.
2023-07-14 12:24:50,979 INFO web.WebHdfsFileSystem: Retrying connect to namenode: blue-nn1.host/10.10.10.10:9470. Already retried 7 time(s); retry policy is org.apache.hadoop.io.retry.RetryPolicies$FailoverOnNetworkExceptionRetry@95e33cc, delay 10374ms.
2023-07-14 12:25:01,385 INFO web.WebHdfsFileSystem: Retrying connect to namenode: blue-nn1.host/10.10.10.10:9470. Already retried 8 time(s); retry policy is org.apache.hadoop.io.retry.RetryPolicies$FailoverOnNetworkExceptionRetry@95e33cc, delay 16640ms.
2023-07-14 12:25:18,059 INFO web.WebHdfsFileSystem: Retrying connect to namenode: blue-nn1.host/10.10.10.10:9470. Already retried 9 time(s); retry policy is org.apache.hadoop.io.retry.RetryPolicies$FailoverOnNetworkExceptionRetry@95e33cc, delay 15514ms.
2023-07-14 12:25:33,610 INFO web.WebHdfsFileSystem: Retrying connect to namenode: blue-nn1.host/10.10.10.10:9470. Already retried 10 time(s); retry policy is org.apache.hadoop.io.retry.RetryPolicies$FailoverOnNetworkExceptionRetry@95e33cc, delay 10745ms.
ls: Namenode is in startup mode
How was this patch tested?
Added unit test. Also verified on a real HA cluster that client-side failover works correctly after the fix.
For code changes:
Does the title or this PR starts with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')?
Object storage: have the integration tests been executed and the endpoint declared according to the connector-specific documentation?
If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
If applicable, have you updated the LICENSE, LICENSE-binary, NOTICE-binary files?
AI Tooling
If an AI tool was used:
The PR includes the phrase "Contains content generated by "
where is the name of the AI tool used.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of PR
When NameNode is configured with HA and NameNode 1 is restarting and loading fsimage, accessing WebHDFS does not trigger client-side failover.
During fsimage loading after NameNode restart in HA configuration, WebHDFS returns RetriableException instead of StandbyException. Because of this, the client-side failover does not work and the client keeps retrying the same NameNode. Eventually the client fails because it cannot find the active NameNode.
How was this patch tested?
Added unit test. Also verified on a real HA cluster that client-side failover works correctly after the fix.
For code changes:
LICENSE,LICENSE-binary,NOTICE-binaryfiles?AI Tooling
If an AI tool was used:
where is the name of the AI tool used.
https://www.apache.org/legal/generative-tooling.html