sodonnel commented on a change in pull request #1549:
URL: https://github.com/apache/ozone/pull/1549#discussion_r519926884
##########
File path:
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/TestSchemaOneBackwardsCompatibility.java
##########
@@ -269,29 +272,29 @@ public void testDelete() throws Exception {
*/
@Test
public void testReadDeletedBlockChunkInfo() throws Exception {
- try(ReferenceCountedDB refCountedDB = BlockUtils.getDB(newKvData(), conf))
{
+ KeyValueContainerData kvData = newKvData();
+ List<? extends Table.KeyValue<String, ChunkInfoList>> deletedBlocks;
+ Set<String> preUpgradeBlocks = new HashSet<>();
+ try(ReferenceCountedDB refCountedDB = BlockUtils.getDB(kvData, conf)) {
// Read blocks that were already deleted before the upgrade.
- List<? extends Table.KeyValue<String, ChunkInfoList>> deletedBlocks =
- refCountedDB.getStore()
- .getDeletedBlocksTable().getRangeKVs(null, 100);
-
- Set<String> preUpgradeBlocks = new HashSet<>();
+ deletedBlocks = refCountedDB.getStore()
+ .getDeletedBlocksTable().getRangeKVs(null, 100);
- for(Table.KeyValue<String, ChunkInfoList> chunkListKV: deletedBlocks) {
+ for (Table.KeyValue<String, ChunkInfoList> chunkListKV : deletedBlocks) {
preUpgradeBlocks.add(chunkListKV.getKey());
try {
chunkListKV.getValue();
Assert.fail("No exception thrown when trying to retrieve old " +
- "deleted blocks values as chunk lists.");
- } catch(IOException ex) {
+ "deleted blocks values as chunk lists.");
+ } catch (IOException ex) {
// Exception thrown as expected.
}
}
+ }
- Assert.assertEquals(TestDB.NUM_DELETED_BLOCKS, preUpgradeBlocks.size());
Review comment:
That seems like a mistake, as I don't remember intentionally changing
it. I did have some problems getting these tests to pass.
However now I have refactored the container opening part to handle the case
where there is already a DB in the cache, I think the changes to this class are
not needed. I have reverted them all and the tests pass locally, so lets see
how the latest CI run goes.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]