HDDS-4680. Change default OM Node ID from UUID to a constant#1793
Merged
hanishakoneru merged 3 commits intoapache:masterfrom Jan 15, 2021
Merged
HDDS-4680. Change default OM Node ID from UUID to a constant#1793hanishakoneru merged 3 commits intoapache:masterfrom
hanishakoneru merged 3 commits intoapache:masterfrom
Conversation
arp7
reviewed
Jan 14, 2021
| public static final String OM_DEFAULT_NODE_ID = "om1"; | ||
|
|
||
| // Dummy OMNodeID for OM Clients to use for a non-HA OM setup | ||
| public static final String OM_NODE_ID_DUMMY = "omNodeIdDummy"; |
Contributor
There was a problem hiding this comment.
I assume this omNodeIdDummy will only be use if someone disables Ratis?
Contributor
Author
There was a problem hiding this comment.
No, this would be used for single node Ratis also.
Contributor
There was a problem hiding this comment.
Sorry I didn't understand then - how do we use both OM_DEFAULT_NODE_ID and OM_NODE_ID_DUMMY with single node Ratis?
Contributor
Author
There was a problem hiding this comment.
OM_NODE_ID_DUMMY was being used just as a dummy nodeId in OMFailoverProxyProvider for non-HA cluster.
But now that we have a default, we should remove the dummy. It would not affect the client in anyway as this is only for non-HA.
Thanks for pointing this out Arpit. I will update the PR.
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.
What changes were proposed in this pull request?
If a nodeID is not set explicitly (for a single node OM cluster), then it defaults to the OM storage ID which is an UUID string. Proposing to change this default to a constant (such as "om1") instead.
This would help when a cluster is upgraded to HA for example. It is not straightforward to change the nodeID after Ratis server has been instantiated (as the nodeID is used to generate the RaftPeerID). Hence, it would be good to have a more readable nodeID by default.
Note that existing single node Ratis enabled OM clusters will have to set the nodeId explicitly if upgraded.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-4680
How was this patch tested?
Manually tested.