lokeshj1703 commented on a change in pull request #29: HDDS-2034. Async RATIS
pipeline creation and destroy through heartbeat commands
URL: https://github.com/apache/hadoop-ozone/pull/29#discussion_r338619918
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/safemode/OneReplicaPipelineSafeModeRule.java
##########
@@ -75,24 +68,33 @@ public OneReplicaPipelineSafeModeRule(String ruleName,
EventQueue eventQueue,
HDDS_SCM_SAFEMODE_ONE_NODE_REPORTED_PIPELINE_PCT +
" value should be >= 0.0 and <= 1.0");
- int totalPipelineCount =
- pipelineManager.getPipelines(HddsProtos.ReplicationType.RATIS,
- HddsProtos.ReplicationFactor.THREE).size();
+ oldPipelineIDSet = pipelineManager.getPipelines(
+ HddsProtos.ReplicationType.RATIS,
+ HddsProtos.ReplicationFactor.THREE)
+ .stream().map(p -> p.getId()).collect(Collectors.toSet());
+ int totalPipelineCount = oldPipelineIDSet.size();
thresholdCount = (int) Math.ceil(percent * totalPipelineCount);
- LOG.info(" Total pipeline count is {}, pipeline's with atleast one " +
+ LOG.info("Total pipeline count is {}, pipeline's with at least one " +
"datanode reported threshold count is {}", totalPipelineCount,
thresholdCount);
getSafeModeMetrics().setNumPipelinesWithAtleastOneReplicaReportedThreshold(
thresholdCount);
+ boolean createPipelineInSafemode = configuration.getBoolean(
+ HddsConfigKeys.HDDS_SCM_SAFEMODE_PIPELINE_CREATION,
+ HddsConfigKeys.HDDS_SCM_SAFEMODE_PIPELINE_CREATION_DEFAULT);
+
+ if (createPipelineInSafemode) {
+ pipelineManager.startPipelineCreator();
+ }
Review comment:
NIT: Could we move this to SCMSafeModeManager after creation of
OnePipelineSafeModeRule?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]