HDDS-420. putKey failing with KEY_ALLOCATION_ERROR. Contributed by Shashikant Banerjee.

This commit is contained in:
Mukul Kumar Singh 2018-09-13 11:29:31 +05:30
parent d7c0a08a1c
commit c6e19db197
5 changed files with 14 additions and 5 deletions

View File

@ -280,7 +280,7 @@ public void addPipelineActionIfAbsent(PipelineAction pipelineAction) {
&& pipelineActionIter.hasClosePipeline() && pipelineAction
.hasClosePipeline()
&& pipelineActionIter.getClosePipeline().getPipelineID()
== pipelineAction.getClosePipeline().getPipelineID()) {
.equals(pipelineAction.getClosePipeline().getPipelineID())) {
return;
}
}

View File

@ -397,6 +397,9 @@ private void handlePipelineFailure(RaftGroupId groupId,
.setAction(PipelineAction.Action.CLOSE)
.build();
context.addPipelineActionIfAbsent(action);
LOG.debug(
"pipeline Action " + action.getAction() + " on pipeline " + pipelineID
+ ".Reason : " + action.getClosePipeline().getDetailedReason());
}
void handleNodeSlowness(

View File

@ -25,6 +25,8 @@
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 @@
* 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 void onMessage(DatanodeDetails datanodeDetails,
Set<PipelineID> pipelineIDs =
containerManager.getPipelineOnDatanode(datanodeDetails);
for (PipelineID id : pipelineIDs) {
LOG.info("closing pipeline {}.", id);
publisher.fireEvent(SCMEvents.PIPELINE_CLOSE, id);
}
}

View File

@ -50,6 +50,8 @@ public void onMessage(PipelineActionsFromDatanode report,
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:

View File

@ -110,15 +110,15 @@ public void initializePipeline(Pipeline pipeline) throws IOException {
* 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();
}
}
/**