duongnguyen0 commented on code in PR #3673:
URL: https://github.com/apache/ozone/pull/3673#discussion_r943660480


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/utils/db/DatanodeDBProfile.java:
##########
@@ -120,15 +116,19 @@ private ManagedDBOptions getDBOptions() {
 
     private ManagedColumnFamilyOptions getColumnFamilyOptions(
         ConfigurationSource config) {
-      cfOptions.updateAndGet(op -> op != null ? op :
-          baseProfile.getColumnFamilyOptions()
-              .setTableFormatConfig(getBlockBasedTableConfig(config)));
-      return cfOptions.get();
+      ManagedColumnFamilyOptions cfOptions =
+          baseProfile.getColumnFamilyOptions();
+      if (cfOptions.tableFormatConfig() instanceof
+          ManagedBlockBasedTableConfig) {
+        ((ManagedBlockBasedTableConfig) cfOptions.tableFormatConfig()).close();
+      }
+      return cfOptions
+              .setTableFormatConfig(getBlockBasedTableConfig(config));

Review Comment:
   Got it. I assumed we should always use those objects in non-competing 
contexts.
   Yet we should preserve correctness for future usages. 



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