Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,29 +81,21 @@ public final class HddsConfigKeys {
public static final String HDDS_SCM_SAFEMODE_PIPELINE_AVAILABILITY_CHECK =
"hdds.scm.safemode.pipeline-availability.check";
public static final boolean
HDDS_SCM_SAFEMODE_PIPELINE_AVAILABILITY_CHECK_DEFAULT = true;

public static final String HDDS_SCM_SAFEMODE_PIPELINE_CREATION =
"hdds.scm.safemode.pipeline.creation";
public static final boolean
HDDS_SCM_SAFEMODE_PIPELINE_CREATION_DEFAULT = true;
HDDS_SCM_SAFEMODE_PIPELINE_AVAILABILITY_CHECK_DEFAULT = false;

// % of containers which should have at least one reported replica
// before SCM comes out of safe mode.
public static final String HDDS_SCM_SAFEMODE_THRESHOLD_PCT =
"hdds.scm.safemode.threshold.pct";
public static final double HDDS_SCM_SAFEMODE_THRESHOLD_PCT_DEFAULT = 0.99;


// percentage of healthy pipelines, where all 3 datanodes are reported in the
// pipeline.
public static final String HDDS_SCM_SAFEMODE_HEALTHY_PIPELINE_THRESHOLD_PCT =
"hdds.scm.safemode.healthy.pipelie.pct";
public static final double
HDDS_SCM_SAFEMODE_HEALTHY_PIPELINE_THRESHOLD_PCT_DEFAULT = 0.10;
// number of healthy RATIS pipeline(ONE or THREE factor)
public static final String HDDS_SCM_SAFEMODE_MIN_PIPELINE =
"hdds.scm.safemode.min.pipeline";
public static final int HDDS_SCM_SAFEMODE_MIN_PIPELINE_DEFAULT = 1;

public static final String HDDS_SCM_SAFEMODE_ONE_NODE_REPORTED_PIPELINE_PCT =
"hdds.scm.safemode.atleast.one.node.reported.pipeline.pct";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,6 @@ public boolean isOpen() {
return state == PipelineState.OPEN;
}

public boolean isAllocationTimeout() {
//TODO: define a system property to control the timeout value
return false;
}

public void setNodesInOrder(List<DatanodeDetails> nodes) {
nodesInOrder.set(nodes);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;

/**
Expand Down Expand Up @@ -73,9 +72,9 @@ public void schedule(CheckedRunnable runnable, long delay,
}, delay, timeUnit);
}

public ScheduledFuture<?> scheduleWithFixedDelay(Runnable runnable,
long initialDelay, long fixedDelay, TimeUnit timeUnit) {
return scheduler
public void scheduleWithFixedDelay(Runnable runnable, long initialDelay,
long fixedDelay, TimeUnit timeUnit) {
scheduler
.scheduleWithFixedDelay(runnable, initialDelay, fixedDelay, timeUnit);
}

Expand Down
30 changes: 10 additions & 20 deletions hadoop-hdds/common/src/main/resources/ozone-default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,15 @@
datanode periodically send container report to SCM. Unit could be
defined with postfix (ns,ms,s,m,h,d)</description>
</property>
<property>
<name>hdds.command.status.report.interval</name>
<value>60000ms</value>
<tag>OZONE, CONTAINER, MANAGEMENT</tag>
<description>Time interval of the datanode to send status of command
execution. Each datanode periodically the execution status of commands
received from SCM to SCM. Unit could be defined with postfix
(ns,ms,s,m,h,d)</description>
</property>
<property>
<name>hdds.pipeline.report.interval</name>
<value>60000ms</value>
Expand Down Expand Up @@ -1291,7 +1300,7 @@

<property>
<name>hdds.scm.safemode.pipeline-availability.check</name>
<value>true</value>
<value>false</value>
<tag>HDDS,SCM,OPERATION</tag>
<description>
Boolean value to enable pipeline availability check during SCM safe mode.
Expand Down Expand Up @@ -1376,25 +1385,6 @@
</description>
</property>

<property>
<name>hdds.scm.safemode.pipeline.creation</name>
<value>true</value>
<tag>HDDS,SCM,OPERATION</tag>
<description>
Boolean value to enable background pipeline creation in SCM safe mode.
</description>
</property>

<property>
<name>hdds.scm.safemode.min.pipeline</name>
<value>1</value>
<tag>HDDS,SCM,OPERATION</tag>
<description>
Minimum RATIS pipeline number to exit SCM safe mode. Considered only when
"hdds.scm.safemode.pipeline.creation" is True.
</description>
</property>

<property>
<name>hdds.lock.max.concurrency</name>
<value>100</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,8 @@
import org.apache.hadoop.ozone.container.common.report.ReportManager;
import org.apache.hadoop.ozone.container.common.statemachine.commandhandler
.CloseContainerCommandHandler;
import org.apache.hadoop.ozone.container.common.statemachine.commandhandler
.ClosePipelineCommandHandler;
import org.apache.hadoop.ozone.container.common.statemachine.commandhandler
.CommandDispatcher;
import org.apache.hadoop.ozone.container.common.statemachine.commandhandler
.CreatePipelineCommandHandler;
import org.apache.hadoop.ozone.container.common.statemachine.commandhandler
.DeleteBlocksCommandHandler;
import org.apache.hadoop.ozone.container.common.statemachine.commandhandler
Expand Down Expand Up @@ -135,8 +131,6 @@ public DatanodeStateMachine(DatanodeDetails datanodeDetails,
conf))
.addHandler(new ReplicateContainerCommandHandler(conf, supervisor))
.addHandler(new DeleteContainerCommandHandler())
.addHandler(new ClosePipelineCommandHandler())
.addHandler(new CreatePipelineCommandHandler())
.setConnectionManager(connectionManager)
.setContainer(container)
.setContext(context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.util.concurrent.atomic.AtomicLong;

/**
* Handler for close container command received from SCM.
Expand All @@ -49,7 +48,7 @@ public class CloseContainerCommandHandler implements CommandHandler {
private static final Logger LOG =
LoggerFactory.getLogger(CloseContainerCommandHandler.class);

private AtomicLong invocationCount = new AtomicLong(0);
private int invocationCount;
private long totalTime;

/**
Expand All @@ -70,7 +69,7 @@ public CloseContainerCommandHandler() {
public void handle(SCMCommand command, OzoneContainer ozoneContainer,
StateContext context, SCMConnectionManager connectionManager) {
LOG.debug("Processing Close Container command.");
invocationCount.incrementAndGet();
invocationCount++;
final long startTime = Time.monotonicNow();
final DatanodeDetails datanodeDetails = context.getParent()
.getDatanodeDetails();
Expand Down Expand Up @@ -162,7 +161,7 @@ public SCMCommandProto.Type getCommandType() {
*/
@Override
public int getInvocationCount() {
return (int)invocationCount.get();
return invocationCount;
}

/**
Expand All @@ -172,8 +171,8 @@ public int getInvocationCount() {
*/
@Override
public long getAverageRunTime() {
if (invocationCount.get() > 0) {
return totalTime / invocationCount.get();
if (invocationCount > 0) {
return totalTime / invocationCount;
}
return 0;
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void handle(SCMCommand command, OzoneContainer container,
default void updateCommandStatus(StateContext context, SCMCommand command,
Consumer<CommandStatus> cmdStatusUpdater, Logger log) {
if (!context.updateCommandStatus(command.getId(), cmdStatusUpdater)) {
log.warn("{} with Id:{} not found.", command.getType(),
log.debug("{} with Id:{} not found.", command.getType(),
command.getId());
}
}
Expand Down
Loading