Skip to content
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

HDDS-1198. Rename chill mode to safe mode. Contributed by Siddharth Wagle. #737

Merged
merged 2 commits into from
Apr 13, 2019
Merged
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 @@ -447,22 +447,22 @@ public long getContainerSize(long containerID) throws IOException {
}

/**
* Check if SCM is in chill mode.
* Check if SCM is in safe mode.
*
* @return Returns true if SCM is in chill mode else returns false.
* @return Returns true if SCM is in safe mode else returns false.
* @throws IOException
*/
public boolean inChillMode() throws IOException {
return storageContainerLocationClient.inChillMode();
public boolean inSafeMode() throws IOException {
return storageContainerLocationClient.inSafeMode();
}

/**
* Force SCM out of chill mode.
* Force SCM out of safe mode.
*
* @return returns true if operation is successful.
* @throws IOException
*/
public boolean forceExitChillMode() throws IOException {
return storageContainerLocationClient.forceExitChillMode();
public boolean forceExitSafeMode() throws IOException {
return storageContainerLocationClient.forceExitSafeMode();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,47 +63,47 @@ public final class HddsConfigKeys {
public static final String HDDS_CONTAINER_CLOSE_THRESHOLD =
"hdds.container.close.threshold";
public static final float HDDS_CONTAINER_CLOSE_THRESHOLD_DEFAULT = 0.9f;
public static final String HDDS_SCM_CHILLMODE_ENABLED =
"hdds.scm.chillmode.enabled";
public static final String HDDS_SCM_SAFEMODE_ENABLED =
"hdds.scm.safemode.enabled";
public static final String HDDS_CONTAINERSCRUB_ENABLED =
"hdds.containerscrub.enabled";
public static final boolean HDDS_CONTAINERSCRUB_ENABLED_DEFAULT = false;
public static final boolean HDDS_SCM_CHILLMODE_ENABLED_DEFAULT = true;
public static final String HDDS_SCM_CHILLMODE_MIN_DATANODE =
"hdds.scm.chillmode.min.datanode";
public static final int HDDS_SCM_CHILLMODE_MIN_DATANODE_DEFAULT = 1;
public static final boolean HDDS_SCM_SAFEMODE_ENABLED_DEFAULT = true;
public static final String HDDS_SCM_SAFEMODE_MIN_DATANODE =
"hdds.scm.safemode.min.datanode";
public static final int HDDS_SCM_SAFEMODE_MIN_DATANODE_DEFAULT = 1;


public static final String
HDDS_SCM_WAIT_TIME_AFTER_CHILL_MODE_EXIT =
"hdds.scm.wait.time.after.chillmode.exit";
HDDS_SCM_WAIT_TIME_AFTER_SAFE_MODE_EXIT =
"hdds.scm.wait.time.after.safemode.exit";

public static final String
HDDS_SCM_WAIT_TIME_AFTER_CHILL_MODE_EXIT_DEFAULT = "5m";
HDDS_SCM_WAIT_TIME_AFTER_SAFE_MODE_EXIT_DEFAULT = "5m";

public static final String HDDS_SCM_CHILLMODE_PIPELINE_AVAILABILITY_CHECK =
"hdds.scm.chillmode.pipeline-availability.check";
public static final String HDDS_SCM_SAFEMODE_PIPELINE_AVAILABILITY_CHECK =
"hdds.scm.safemode.pipeline-availability.check";
public static final boolean
HDDS_SCM_CHILLMODE_PIPELINE_AVAILABILITY_CHECK_DEFAULT = false;
HDDS_SCM_SAFEMODE_PIPELINE_AVAILABILITY_CHECK_DEFAULT = false;

// % of containers which should have at least one reported replica
// before SCM comes out of chill mode.
public static final String HDDS_SCM_CHILLMODE_THRESHOLD_PCT =
"hdds.scm.chillmode.threshold.pct";
public static final double HDDS_SCM_CHILLMODE_THRESHOLD_PCT_DEFAULT = 0.99;
// 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_CHILLMODE_HEALTHY_PIPELINE_THRESHOLD_PCT =
"hdds.scm.chillmode.healthy.pipelie.pct";
public static final String HDDS_SCM_SAFEMODE_HEALTHY_PIPELINE_THRESHOLD_PCT =
"hdds.scm.safemode.healthy.pipelie.pct";
public static final double
HDDS_SCM_CHILLMODE_HEALTHY_PIPELINE_THRESHOLD_PCT_DEFAULT = 0.10;
HDDS_SCM_SAFEMODE_HEALTHY_PIPELINE_THRESHOLD_PCT_DEFAULT = 0.10;

public static final String HDDS_SCM_CHILLMODE_ONE_NODE_REPORTED_PIPELINE_PCT =
"hdds.scm.chillmode.atleast.one.node.reported.pipeline.pct";
public static final String HDDS_SCM_SAFEMODE_ONE_NODE_REPORTED_PIPELINE_PCT =
"hdds.scm.safemode.atleast.one.node.reported.pipeline.pct";
public static final double
HDDS_SCM_CHILLMODE_ONE_NODE_REPORTED_PIPELINE_PCT_DEFAULT = 0.90;
HDDS_SCM_SAFEMODE_ONE_NODE_REPORTED_PIPELINE_PCT_DEFAULT = 0.90;

public static final String HDDS_LOCK_MAX_CONCURRENCY =
"hdds.lock.max.concurrency";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,18 +189,18 @@ Pipeline createReplicationPipeline(HddsProtos.ReplicationType type,
void closePipeline(HddsProtos.PipelineID pipelineID) throws IOException;

/**
* Check if SCM is in chill mode.
* Check if SCM is in safe mode.
*
* @return Returns true if SCM is in chill mode else returns false.
* @return Returns true if SCM is in safe mode else returns false.
* @throws IOException
*/
boolean inChillMode() throws IOException;
boolean inSafeMode() throws IOException;

/**
* Force SCM out of chill mode.
* Force SCM out of safe mode.
*
* @return returns true if operation is successful.
* @throws IOException
*/
boolean forceExitChillMode() throws IOException;
boolean forceExitSafeMode() throws IOException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -163,18 +163,18 @@ Pipeline createReplicationPipeline(HddsProtos.ReplicationType type,
ScmInfo getScmInfo() throws IOException;

/**
* Check if SCM is in chill mode.
* Check if SCM is in safe mode.
*
* @return Returns true if SCM is in chill mode else returns false.
* @return Returns true if SCM is in safe mode else returns false.
* @throws IOException
*/
boolean inChillMode() throws IOException;
boolean inSafeMode() throws IOException;

/**
* Force SCM out of Chill mode.
* Force SCM out of Safe mode.
*
* @return returns true if operation is successful.
* @throws IOException
*/
boolean forceExitChillMode() throws IOException;
boolean forceExitSafeMode() throws IOException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
import org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.ListPipelineRequestProto;
import org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.ListPipelineResponseProto;
import org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.ClosePipelineRequestProto;
import org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.ForceExitChillModeRequestProto;
import org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.ForceExitChillModeResponseProto;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line length greater than 80.

import org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.ForceExitSafeModeRequestProto;
import org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.ForceExitSafeModeResponseProto;
import org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.GetContainerWithPipelineRequestProto;
import org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.GetContainerWithPipelineResponseProto;
import org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.InChillModeRequestProto;
import org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.InChillModeResponseProto;
import org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.InSafeModeRequestProto;
import org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.InSafeModeResponseProto;
import org.apache.hadoop.hdds.scm.ScmInfo;
import org.apache.hadoop.hdds.scm.container.common.helpers.ContainerWithPipeline;
import org.apache.hadoop.hdds.scm.container.ContainerInfo;
Expand Down Expand Up @@ -370,38 +370,38 @@ public ScmInfo getScmInfo() throws IOException {
}

/**
* Check if SCM is in chill mode.
* Check if SCM is in safe mode.
*
* @return Returns true if SCM is in chill mode else returns false.
* @return Returns true if SCM is in safe mode else returns false.
* @throws IOException
*/
@Override
public boolean inChillMode() throws IOException {
InChillModeRequestProto request =
InChillModeRequestProto.getDefaultInstance();
public boolean inSafeMode() throws IOException {
InSafeModeRequestProto request =
InSafeModeRequestProto.getDefaultInstance();
try {
InChillModeResponseProto resp = rpcProxy.inChillMode(
InSafeModeResponseProto resp = rpcProxy.inSafeMode(
NULL_RPC_CONTROLLER, request);
return resp.getInChillMode();
return resp.getInSafeMode();
} catch (ServiceException e) {
throw ProtobufHelper.getRemoteException(e);
}
}

/**
* Force SCM out of Chill mode.
* Force SCM out of Safe mode.
*
* @return returns true if operation is successful.
* @throws IOException
*/
@Override
public boolean forceExitChillMode() throws IOException {
ForceExitChillModeRequestProto request =
ForceExitChillModeRequestProto.getDefaultInstance();
public boolean forceExitSafeMode() throws IOException {
ForceExitSafeModeRequestProto request =
ForceExitSafeModeRequestProto.getDefaultInstance();
try {
ForceExitChillModeResponseProto resp = rpcProxy
.forceExitChillMode(NULL_RPC_CONTROLLER, request);
return resp.getExitedChillMode();
ForceExitSafeModeResponseProto resp = rpcProxy
.forceExitSafeMode(NULL_RPC_CONTROLLER, request);
return resp.getExitedSafeMode();
} catch (ServiceException e) {
throw ProtobufHelper.getRemoteException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public enum SCMAction implements AuditAction {
LIST_PIPELINE,
CLOSE_PIPELINE,
DELETE_CONTAINER,
IN_CHILL_MODE,
FORCE_EXIT_CHILL_MODE;
IN_SAFE_MODE,
FORCE_EXIT_SAFE_MODE;

@Override
public String getAction() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@

import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.hdds.protocol.proto
.StorageContainerLocationProtocolProtos.InChillModeRequestProto;
.StorageContainerLocationProtocolProtos.InSafeModeRequestProto;
import org.apache.hadoop.hdds.protocol.proto
.StorageContainerLocationProtocolProtos.InChillModeResponseProto;
.StorageContainerLocationProtocolProtos.InSafeModeResponseProto;
import org.apache.hadoop.hdds.protocol.proto
.StorageContainerLocationProtocolProtos.ForceExitChillModeRequestProto;
.StorageContainerLocationProtocolProtos.ForceExitSafeModeRequestProto;
import org.apache.hadoop.hdds.protocol.proto
.StorageContainerLocationProtocolProtos.ForceExitChillModeResponseProto;
.StorageContainerLocationProtocolProtos.ForceExitSafeModeResponseProto;
import org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.GetContainerWithPipelineRequestProto;
import org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.GetContainerWithPipelineResponseProto;
import org.apache.hadoop.hdds.scm.ScmInfo;
Expand Down Expand Up @@ -282,26 +282,26 @@ public HddsProtos.GetScmInfoRespsonseProto getScmInfo(
}

@Override
public InChillModeResponseProto inChillMode(
public InSafeModeResponseProto inSafeMode(
RpcController controller,
InChillModeRequestProto request) throws ServiceException {
InSafeModeRequestProto request) throws ServiceException {
try (Scope scope = TracingUtil
.importAndCreateScope("inChillMode", request.getTraceID())) {
return InChillModeResponseProto.newBuilder()
.setInChillMode(impl.inChillMode()).build();
.importAndCreateScope("inSafeMode", request.getTraceID())) {
return InSafeModeResponseProto.newBuilder()
.setInSafeMode(impl.inSafeMode()).build();
} catch (IOException ex) {
throw new ServiceException(ex);
}
}

@Override
public ForceExitChillModeResponseProto forceExitChillMode(
RpcController controller, ForceExitChillModeRequestProto request)
public ForceExitSafeModeResponseProto forceExitSafeMode(
RpcController controller, ForceExitSafeModeRequestProto request)
throws ServiceException {
try (Scope scope = TracingUtil
.importAndCreateScope("forceExitChillMode", request.getTraceID())) {
return ForceExitChillModeResponseProto.newBuilder()
.setExitedChillMode(impl.forceExitChillMode()).build();
.importAndCreateScope("forceExitSafeMode", request.getTraceID())) {
return ForceExitSafeModeResponseProto.newBuilder()
.setExitedSafeMode(impl.forceExitSafeMode()).build();
} catch (IOException ex) {
throw new ServiceException(ex);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ message DeleteKeyBlocksResultProto {
message DeleteScmBlockResult {
enum Result {
success = 1;
chillMode = 2;
safeMode = 2;
errorNotFound = 3;
unknownFailure = 4;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,20 +176,20 @@ message ClosePipelineRequestProto {
message ClosePipelineResponseProto {
}

message InChillModeRequestProto {
message InSafeModeRequestProto {
optional string traceID = 1;
}

message InChillModeResponseProto {
required bool inChillMode = 1;
message InSafeModeResponseProto {
required bool inSafeMode = 1;
}

message ForceExitChillModeRequestProto {
message ForceExitSafeModeRequestProto {
optional string traceID = 1;
}

message ForceExitChillModeResponseProto {
required bool exitedChillMode = 1;
message ForceExitSafeModeResponseProto {
required bool exitedSafeMode = 1;
}

/**
Expand Down Expand Up @@ -265,14 +265,14 @@ service StorageContainerLocationProtocolService {
returns (GetScmInfoRespsonseProto);

/**
* Checks if SCM is in ChillMode.
* Checks if SCM is in SafeMode.
*/
rpc inChillMode(InChillModeRequestProto)
returns (InChillModeResponseProto);
rpc inSafeMode(InSafeModeRequestProto)
returns (InSafeModeResponseProto);

/**
* Returns information about SCM.
*/
rpc forceExitChillMode(ForceExitChillModeRequestProto)
returns (ForceExitChillModeResponseProto);
rpc forceExitSafeMode(ForceExitSafeModeRequestProto)
returns (ForceExitSafeModeResponseProto);
}
Loading