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


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java:
##########
@@ -2127,9 +2129,15 @@ <KEY, VALUE> Table<KEY, VALUE> 
get(DBColumnFamilyDefinition<KEY, VALUE> definiti
       return get(definition.getTable(store));
     }
 
-    <KEY, VALUE> Table<KEY, VALUE> get(DBColumnFamilyDefinition<KEY, VALUE> 
definition, CacheType cacheType)
+    <KEY, VALUE> Table<KEY, VALUE> get(DBColumnFamilyDefinition<KEY, VALUE> 
definition, CacheType tableCacheType)
         throws IOException {
-      return get(definition.getTable(store, cacheType));
+      // A FULL_CACHE table loads the whole table and starts a cleanup thread 
on every open, so a DB opened with
+      // PARTIAL_CACHE (snapshot and checkpoint DBs, which are opened and 
closed repeatedly) must not have one.
+      if (tableCacheType == CacheType.FULL_CACHE && cacheType != 
CacheType.FULL_CACHE) {
+        throw new IllegalArgumentException("Table " + definition.getName() + " 
must not use " + tableCacheType
+            + " in a DB opened with " + cacheType);

Review Comment:
   Good catch, thanks. Both constructors now call `stop()` when table 
initialization fails with an `IOException` or a `RuntimeException`, so a 
rejected FULL_CACHE table no longer leaves the store open. 
`testFailedSnapshotDbOpenClosesStore` covers both paths. Fixed in 
82f2d33c0bc53f37dde3d3c279e318d914ae91bb.
   
   _🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
   



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