smengcl commented on code in PR #11428:
URL: https://github.com/apache/ozone/pull/11428#discussion_r4279153058


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/diff/SnapDiffJobStore.java:
##########
@@ -710,6 +781,7 @@ public void close() throws IOException {
     while (!temporaryColumnFamilies.isEmpty()) {
       dropAndClose(temporaryColumnFamilies.get(0));
     }
+    closeDeeply(tmpCfFamilyOptions);

Review Comment:
   Can we close only the copied column-family options here? RocksDB's 
`ColumnFamilyOptions` copy constructor retains the same `tableFormatConfig` 
object. If the supplied options use a `ManagedBlockBasedTableConfig` (as 
`DBProfile.SSD/TEST` do), `closeDeeply` also closes the caller's shared 
block-cache and Bloom-filter handles, leaving those handles unusable even 
though the caller still owns its options.
   
   I reproduced this with `SnapDiffJobStore.open()` on this head: after closing 
the store, the original table config is closed and both caller-owned handles 
have `isOwningHandle() == false`. Closing just the copied options preserves 
them. Please cover this ownership case in a regression test.
   
   ```diff
   -import static 
org.apache.hadoop.hdds.utils.db.managed.ManagedColumnFamilyOptions.closeDeeply;
   @@
   -    closeDeeply(tmpCfFamilyOptions);
   +    tmpCfFamilyOptions.close();
   ```



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

To unsubscribe, e-mail: [email protected]

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