Repository navigation
Conversation
…ret key from SCM Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adoroszlai
reviewed
Oct 24, 2026
adoroszlai
left a comment
Contributor
There was a problem hiding this comment.
Thanks @smengcl for the patch.
| import static org.apache.hadoop.io.retry.RetryPolicy.RetryAction.FAIL; | ||
| import static org.apache.hadoop.io_.retry.RetryPolicies.exponentialBackoffRetry; | ||
|
|
||
| import com.google.common.annotations.VisibleForTesting; |
Contributor
There was a problem hiding this comment.
nit: please don't add new @VisibleForTesting annotations.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Generated-by: Claude Code (Opus 5.5)
What changes were proposed in this pull request?
At startup, OM and datanode load the current secret key from SCM in
DefaultSecretKeySignerClient.loadInitialSecretKey. While SCM has not initialized secret keys yet, it makes up to 100 attempts with exponential backoff that restarts every 10 retries. The base wait goes 4s, 8s, ..., 1024s, then 2s, randomized by +/-50%, so a single wait can be up to about 25 minutes (about 5.7 hours in total). So after SCM initializes its keys, an OM or datanode can stay stuck for many more minutes before it tries again.This change keeps the exponential backoff but caps the base wait at 16s (4s, 8s, 16s, 16s, ...). A single wait is at most 23s, and the total for 100 attempts is around 26 minutes. The retry policy moves to a package-private method so it can be tested, and the code comment now matches the actual wait times.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-17316
How was this patch tested?
Added
TestDefaultSecretKeyClient#initialSecretKeyRetryWaitIsCapped, which checks that every wait grows as expected and stays within 23s, and that other errors and the attempt after the last retry fail. It fails without the fix.🤖 Generated with Claude Code