bharatviswa504 commented on a change in pull request #1598:
URL: https://github.com/apache/ozone/pull/1598#discussion_r525763319



##########
File path: 
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/response/TestCleanupTableInfo.java
##########
@@ -66,4 +105,188 @@ public void checkAnnotationAndTableName() throws Exception 
{
       }
     });
   }
+
+  @Test
+  public void testHDDS4478() throws Exception {
+    HddsProtos.BlockID blockID = new BlockID(1, 1).getProtobuf();
+    String volume = "testVol";
+    String bucket = "testBuck";
+    String key = "/foo/bar/baz/key";
+
+
+    OMFileCreateRequest request =
+        anOmFileCreateRequest(blockID, volume, bucket, key);
+
+    OMMetadataManager omMetaMgr = createOMMetadataManagerSpy();
+    OMMetrics omMetrics = mock(OMMetrics.class);
+    OzoneManager om =
+        createOzoneManagerMock(volume, bucket, request, omMetaMgr, omMetrics);
+
+    OmVolumeArgs volumeArgs = aVolumeArgs(volume);
+    OmBucketInfo bucketInfo = aBucketInfo(volume, bucket);
+    addVolumeToMetaTable(volume, volumeArgs, omMetaMgr);
+    addBucketToMetaTable(volume, bucket, bucketInfo, omMetaMgr);
+
+    OzoneManagerDoubleBufferHelper dbh =
+        mock(OzoneManagerDoubleBufferHelper.class);
+
+    Map<String, Integer> cacheItemCount = new HashMap<>();
+    for (String tableName : omMetaMgr.listTableNames()){
+      cacheItemCount.put(tableName,
+          Iterators.size(omMetaMgr.getTable(tableName).cacheIterator()));
+    }
+
+
+    request.validateAndUpdateCache(om, 1, dbh);
+
+
+    CleanupTableInfo ann =
+        OMFileCreateResponse.class.getAnnotation(CleanupTableInfo.class);
+    List<String> cleanup = Arrays.asList(ann.cleanupTables());
+    for (String tableName : omMetaMgr.listTableNames()) {
+      if (!cleanup.contains(tableName)) {

Review comment:
       Ya, it makes sense to me. It is basically checking all other table cache 
entries should be what it has an initial value, which should not be changed.




----------------------------------------------------------------
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]

Reply via email to