HDDS-420. putKey failing with KEY_ALLOCATION_ERROR. Contributed by Shashikant Banerjee.
This commit is contained in:
parent
d7c0a08a1c
commit
c6e19db197
|
@ -280,7 +280,7 @@ public class StateContext {
|
|||
&& pipelineActionIter.hasClosePipeline() && pipelineAction
|
||||
.hasClosePipeline()
|
||||
&& pipelineActionIter.getClosePipeline().getPipelineID()
|
||||
== pipelineAction.getClosePipeline().getPipelineID()) {
|
||||
.equals(pipelineAction.getClosePipeline().getPipelineID())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -397,6 +397,9 @@ public final class XceiverServerRatis implements XceiverServerSpi {
|
|||
.setAction(PipelineAction.Action.CLOSE)
|
||||
.build();
|
||||
context.addPipelineActionIfAbsent(action);
|
||||
LOG.debug(
|
||||
"pipeline Action " + action.getAction() + " on pipeline " + pipelineID
|
||||
+ ".Reason : " + action.getClosePipeline().getDetailedReason());
|
||||
}
|
||||
|
||||
void handleNodeSlowness(
|
||||
|
|
|
@ -25,6 +25,8 @@ import org.apache.hadoop.hdds.scm.events.SCMEvents;
|
|||
import org.apache.hadoop.hdds.scm.node.states.Node2ContainerMap;
|
||||
import org.apache.hadoop.hdds.server.events.EventHandler;
|
||||
import org.apache.hadoop.hdds.server.events.EventPublisher;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -32,6 +34,7 @@ import java.util.Set;
|
|||
* Handles Stale node event.
|
||||
*/
|
||||
public class StaleNodeHandler implements EventHandler<DatanodeDetails> {
|
||||
static final Logger LOG = LoggerFactory.getLogger(StaleNodeHandler.class);
|
||||
|
||||
private final Node2ContainerMap node2ContainerMap;
|
||||
private final Mapping containerManager;
|
||||
|
@ -48,6 +51,7 @@ public class StaleNodeHandler implements EventHandler<DatanodeDetails> {
|
|||
Set<PipelineID> pipelineIDs =
|
||||
containerManager.getPipelineOnDatanode(datanodeDetails);
|
||||
for (PipelineID id : pipelineIDs) {
|
||||
LOG.info("closing pipeline {}.", id);
|
||||
publisher.fireEvent(SCMEvents.PIPELINE_CLOSE, id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,6 +50,8 @@ public class PipelineActionEventHandler implements
|
|||
case CLOSE:
|
||||
PipelineID pipelineID = PipelineID.
|
||||
getFromProtobuf(action.getClosePipeline().getPipelineID());
|
||||
LOG.info("Closing pipeline " + pipelineID + " for reason:" + action
|
||||
.getClosePipeline().getDetailedReason());
|
||||
publisher.fireEvent(SCMEvents.PIPELINE_CLOSE, pipelineID);
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -110,15 +110,15 @@ public class RatisManagerImpl extends PipelineManager {
|
|||
* Close the pipeline.
|
||||
*/
|
||||
public void closePipeline(Pipeline pipeline) throws IOException {
|
||||
try (XceiverClientRatis client =
|
||||
XceiverClientRatis.newXceiverClientRatis(pipeline, conf)) {
|
||||
client.destroyPipeline();
|
||||
}
|
||||
super.closePipeline(pipeline);
|
||||
for (DatanodeDetails node : pipeline.getMachines()) {
|
||||
// A node should always be the in ratis members list.
|
||||
Preconditions.checkArgument(ratisMembers.remove(node));
|
||||
}
|
||||
try (XceiverClientRatis client =
|
||||
XceiverClientRatis.newXceiverClientRatis(pipeline, conf)) {
|
||||
client.destroyPipeline();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue