Gabriel39 commented on code in PR #71398:
URL: https://github.com/apache/doris/pull/71398#discussion_r4795560042


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergExternalMetaCache.java:
##########
@@ -1286,14 +1291,25 @@ private ManifestCacheValue loadDeleteFiles(
         return builder.build();
     }
 
+    private void trackManifestFileIo(NameMapping nameMapping, 
IcebergMetadataOps ops, Table table) {
+        try {
+            fileIoTracker.track(nameMapping.getCtlId(), ops, table.io());
+        } catch (Exception e) {
+            // Cache bookkeeping must not reject a custom metadata-only table 
whose IO is unavailable.
+            LOG.warn("Failed to track iceberg FileIO for manifest cache 
cleanup", e);
+        }
+    }
+
     /**
-     * Collect every FileIO a catalog's cached values still retain. A snapshot 
value can outlive
+     * Collect tracked catalog IO as well as IO still retained by cached 
values. A snapshot value can outlive
      * its weighted/expired/collected table entry while retaining the same 
frozen table graph, so
      * both entries are enumerated; identity de-duplication keeps the later 
drop pass bounded.
      */
     private List<FileIO> collectManifestFileIos(long catalogId) {
         IdentityHashMap<FileIO, Boolean> seen = new IdentityHashMap<>();
-        List<FileIO> fileIos = new ArrayList<>();
+        // Writes can outlive every read-cache entry while the captured 
catalog generation still owns IO.
+        List<FileIO> fileIos = fileIoTracker.snapshot(catalogId);

Review Comment:
   Fixed in 8ec0d752dbd5. Iceberg now opts into the existing 
supportsInvalidationWithoutCatalogEntries contract so the manager reaches 
tracked raw and authenticated SDK caches after the Doris group has been 
retired. The tests use a real ExternalMetaCacheMgr, its actual registered 
Iceberg engine and route resolver, using mocked Doris catalog/load contexts 
backed by real HadoopCatalog tables and physical manifest reads. Both Iceberg 
and HMS cases refill through the same retained writer and refresh twice through 
the manager, asserting the group stays absent between calls. These two cases 
fail against the previous production classes and pass with the fix. Additional 
tests verify scoped absent-group invalidation does not initialize a group and 
preserve catalog/generation isolation.



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