HDDS-1310. In datanode once a container becomes unhealthy, datanode restart fails. Contributed by Sandeep Nemuri.
This commit is contained in:
parent
73f7b04e2b
commit
efad5717ec
@ -623,6 +623,9 @@ private ContainerReplicaProto.State getHddsState()
|
|||||||
case CLOSED:
|
case CLOSED:
|
||||||
state = ContainerReplicaProto.State.CLOSED;
|
state = ContainerReplicaProto.State.CLOSED;
|
||||||
break;
|
break;
|
||||||
|
case UNHEALTHY:
|
||||||
|
state = ContainerReplicaProto.State.UNHEALTHY;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
throw new StorageContainerException("Invalid Container state found: " +
|
throw new StorageContainerException("Invalid Container state found: " +
|
||||||
containerData.getContainerID(), INVALID_CONTAINER_STATE);
|
containerData.getContainerID(), INVALID_CONTAINER_STATE);
|
||||||
|
@ -332,6 +332,19 @@ public void testCloseContainer() throws Exception {
|
|||||||
keyValueContainerData.getState());
|
keyValueContainerData.getState());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testReportOfUnhealthyContainer() throws Exception {
|
||||||
|
keyValueContainer.create(volumeSet, volumeChoosingPolicy, scmId);
|
||||||
|
Assert.assertNotNull(keyValueContainer.getContainerReport());
|
||||||
|
keyValueContainer.markContainerUnhealthy();
|
||||||
|
File containerFile = keyValueContainer.getContainerFile();
|
||||||
|
keyValueContainerData = (KeyValueContainerData) ContainerDataYaml
|
||||||
|
.readContainerFile(containerFile);
|
||||||
|
assertEquals(ContainerProtos.ContainerDataProto.State.UNHEALTHY,
|
||||||
|
keyValueContainerData.getState());
|
||||||
|
Assert.assertNotNull(keyValueContainer.getContainerReport());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUpdateContainer() throws IOException {
|
public void testUpdateContainer() throws IOException {
|
||||||
keyValueContainer.create(volumeSet, volumeChoosingPolicy, scmId);
|
keyValueContainer.create(volumeSet, volumeChoosingPolicy, scmId);
|
||||||
|
Loading…
Reference in New Issue
Block a user