HDFS-13026. Ozone: TestContainerPersistence is failing becaue of container data mismatch. Contributed by Mukul Kumar Singh.
This commit is contained in:
parent
28b87af51b
commit
916f31f7d1
@ -98,8 +98,13 @@ public class ChunkManagerImpl implements ChunkManager {
|
|||||||
commitChunk(tmpChunkFile, chunkFile, containerName, info.getLen());
|
commitChunk(tmpChunkFile, chunkFile, containerName, info.getLen());
|
||||||
break;
|
break;
|
||||||
case COMBINED:
|
case COMBINED:
|
||||||
ChunkUtils.writeData(tmpChunkFile, info, data);
|
// directly write to the chunk file
|
||||||
commitChunk(tmpChunkFile, chunkFile, containerName, info.getLen());
|
long oldSize = chunkFile.length();
|
||||||
|
ChunkUtils.writeData(chunkFile, info, data);
|
||||||
|
long newSize = chunkFile.length();
|
||||||
|
containerManager.incrBytesUsed(containerName, newSize - oldSize);
|
||||||
|
containerManager.incrWriteCount(containerName);
|
||||||
|
containerManager.incrWriteBytes(containerName, info.getLen());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch (ExecutionException | NoSuchAlgorithmException | IOException e) {
|
} catch (ExecutionException | NoSuchAlgorithmException | IOException e) {
|
||||||
|
@ -531,8 +531,8 @@ public class TestContainerPersistence {
|
|||||||
try {
|
try {
|
||||||
chunkManager.writeChunk(pipeline, keyName, info, data, COMBINED);
|
chunkManager.writeChunk(pipeline, keyName, info, data, COMBINED);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Assert.assertTrue(ex.getMessage().contains(
|
Assert.assertTrue(ex.getCause().getMessage().contains(
|
||||||
"Rejecting write chunk request. OverWrite flag required."));
|
"Rejecting write chunk request. OverWrite flag required"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// With the overwrite flag it should work now.
|
// With the overwrite flag it should work now.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user