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());
|
||||
break;
|
||||
case COMBINED:
|
||||
ChunkUtils.writeData(tmpChunkFile, info, data);
|
||||
commitChunk(tmpChunkFile, chunkFile, containerName, info.getLen());
|
||||
// directly write to the chunk file
|
||||
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;
|
||||
}
|
||||
} catch (ExecutionException | NoSuchAlgorithmException | IOException e) {
|
||||
|
|
|
@ -531,8 +531,8 @@ public class TestContainerPersistence {
|
|||
try {
|
||||
chunkManager.writeChunk(pipeline, keyName, info, data, COMBINED);
|
||||
} catch (IOException ex) {
|
||||
Assert.assertTrue(ex.getMessage().contains(
|
||||
"Rejecting write chunk request. OverWrite flag required."));
|
||||
Assert.assertTrue(ex.getCause().getMessage().contains(
|
||||
"Rejecting write chunk request. OverWrite flag required"));
|
||||
}
|
||||
|
||||
// With the overwrite flag it should work now.
|
||||
|
|
Loading…
Reference in New Issue