Skip to content
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 @@ -352,6 +352,10 @@ private void processResponse(SCMHeartbeatResponseProto response,
SetNodeOperationalStateCommand setNodeOperationalStateCommand =
SetNodeOperationalStateCommand.getFromProtobuf(
commandResponseProto.getSetNodeOperationalStateCommandProto());
if (commandResponseProto.hasTerm()) {
setNodeOperationalStateCommand.setTerm(
commandResponseProto.getTerm());
}
if (LOG.isDebugEnabled()) {
LOG.debug("Received SCM set operational state command. State: {} " +
"Expiry: {}", setNodeOperationalStateCommand.getOpState(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,13 @@ message SCMCommandProto {
optional ReplicateContainerCommandProto replicateContainerCommandProto = 6;
optional CreatePipelineCommandProto createPipelineCommandProto = 7;
optional ClosePipelineCommandProto closePipelineCommandProto = 8;
optional SetNodeOperationalStateCommandProto setNodeOperationalStateCommandProto = 9;

// Under HA mode, holds term of underlying RaftServer iff current
// SCM is a leader, otherwise, holds term 0.
// Notes that, the first elected leader is from term 1, term 0,
// as the initial value of currentTerm, is never used under HA mode.
optional uint64 term = 15;
optional SetNodeOperationalStateCommandProto setNodeOperationalStateCommandProto = 9;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ private void updateDatanodeOpState(DatanodeDetails reportedDn)
reportedDn.getPersistedOpStateExpiryEpochSec(),
scmStatus.getOperationalState(),
scmStatus.getOpStateExpiryEpochSeconds());
commandQueue.addCommand(reportedDn.getUuid(),
addDatanodeCommand(reportedDn.getUuid(),
new SetNodeOperationalStateCommand(
Time.monotonicNow(), scmStatus.getOperationalState(),
scmStatus.getOpStateExpiryEpochSeconds()));
Expand Down