HDDS-343. Containers are stuck in closing state in scm. Contributed by Elek, Marton.
This commit is contained in:
parent
211034a6c2
commit
567b5558d5
|
@ -22,6 +22,7 @@ import com.google.common.primitives.Longs;
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.conf.StorageUnit;
|
import org.apache.hadoop.conf.StorageUnit;
|
||||||
import org.apache.hadoop.hdds.protocol.DatanodeDetails;
|
import org.apache.hadoop.hdds.protocol.DatanodeDetails;
|
||||||
|
import org.apache.hadoop.hdds.protocol.proto.HddsProtos.LifeCycleEvent;
|
||||||
import org.apache.hadoop.hdds.protocol.proto.HddsProtos.LifeCycleState;
|
import org.apache.hadoop.hdds.protocol.proto.HddsProtos.LifeCycleState;
|
||||||
import org.apache.hadoop.hdds.protocol.proto.HddsProtos.SCMContainerInfo;
|
import org.apache.hadoop.hdds.protocol.proto.HddsProtos.SCMContainerInfo;
|
||||||
import org.apache.hadoop.hdds.scm.block.PendingDeleteStatusList;
|
import org.apache.hadoop.hdds.scm.block.PendingDeleteStatusList;
|
||||||
|
@ -532,6 +533,18 @@ public class ContainerMapping implements Mapping {
|
||||||
HddsProtos.SCMContainerInfo knownState =
|
HddsProtos.SCMContainerInfo knownState =
|
||||||
HddsProtos.SCMContainerInfo.PARSER.parseFrom(containerBytes);
|
HddsProtos.SCMContainerInfo.PARSER.parseFrom(containerBytes);
|
||||||
|
|
||||||
|
if (knownState.getState() == LifeCycleState.CLOSING
|
||||||
|
&& contInfo.getState() == LifeCycleState.CLOSED) {
|
||||||
|
|
||||||
|
updateContainerState(contInfo.getContainerID(),
|
||||||
|
LifeCycleEvent.CLOSE);
|
||||||
|
|
||||||
|
//reread the container
|
||||||
|
knownState =
|
||||||
|
HddsProtos.SCMContainerInfo.PARSER
|
||||||
|
.parseFrom(containerStore.get(dbKey));
|
||||||
|
}
|
||||||
|
|
||||||
HddsProtos.SCMContainerInfo newState =
|
HddsProtos.SCMContainerInfo newState =
|
||||||
reconcileState(contInfo, knownState, datanodeDetails);
|
reconcileState(contInfo, knownState, datanodeDetails);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue