-
Notifications
You must be signed in to change notification settings - Fork 621
HDDS-12378. Change default hdds.scm.safemode.min.datanode to 3 #8331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
96d71a8
d23c395
f4b3218
0be4df6
f683f37
3efcf26
e53e08d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,6 +93,6 @@ key | default | description | |
| ----|---------|------------ | ||
| ozone.scm.container.size | 5GB | Default container size used by Ozone | ||
| ozone.scm.block.size | 256MB | The default size of a data block. | ||
| hdds.scm.safemode.min.datanode | 1 | Minimum number of datanodes to start the real work. | ||
| hdds.scm.safemode.min.datanode | 3 | Minimum number of datanodes to start the real work. | ||
| ozone.scm.http-address | 0.0.0.0:9876 | HTTP address of the SCM server | ||
| ozone.metadata.dirs | none | Directory to store persisted data (RocksDB). | ||
| ozone.metadata.dirs | none | Directory to store persisted data (RocksDB). | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please revert irrelevant change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For some reason I can't revert that as it changes itself and adds an extra line. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,8 @@ | |
| import org.apache.hadoop.hdds.scm.server.SCMDatanodeProtocolServer.NodeRegistrationContainerReport; | ||
| import org.apache.hadoop.hdds.server.events.EventQueue; | ||
| import org.apache.hadoop.hdds.server.events.TypedEvent; | ||
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
||
| /** | ||
| * Class defining Safe mode exit criteria according to number of DataNodes | ||
|
|
@@ -36,6 +38,7 @@ public class DataNodeSafeModeRule extends | |
| SafeModeExitRule<NodeRegistrationContainerReport> { | ||
|
|
||
| private static final String NAME = "DataNodeSafeModeRule"; | ||
| private static final Logger LOG = LoggerFactory.getLogger(DataNodeSafeModeRule.class); | ||
|
|
||
| // Min DataNodes required to exit safe mode. | ||
| private int requiredDns; | ||
|
|
@@ -66,7 +69,17 @@ protected boolean validate() { | |
| if (validateBasedOnReportProcessing()) { | ||
| return registeredDns >= requiredDns; | ||
| } | ||
| return nodeManager.getNodes(NodeStatus.inServiceHealthy()).size() >= requiredDns; | ||
|
|
||
| int healthyCount = nodeManager.getNodes(NodeStatus.inServiceHealthy()).size(); | ||
| int healthyReadOnlyCount = nodeManager.getNodes(NodeStatus.inServiceHealthyReadOnly()).size(); | ||
| int staleCount = nodeManager.getNodes(NodeStatus.inServiceStale()).size(); | ||
|
|
||
| if (healthyCount + healthyReadOnlyCount + staleCount == 1) { | ||
| LOG.warn("Only one Datanode is available in the cluster. " + | ||
| "Consider setting 'hdds.scm.safemode.min.datanode=1' in the configuration."); | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SCM doesn't remember Datanode list across SCM restart. So during SCM restart, initially the datanode list in SCM will be empty and at some point the first Datanode will register making We will end up printing this
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for the review @nandakumar131. Should we add a flag that would indicate that the log message has already been printed? Would it be a good solution?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess we can remove the warning, unless @nandakumar131 has some other suggestion.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need any logging for this. |
||
|
|
||
| return healthyCount >= requiredDns; | ||
| } | ||
|
|
||
| @Override | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also a Chinese version of the doc. Could you please make changes there too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sure.