You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "rahulsmahadev (via GitHub)" <gi...@apache.org> on 2026/06/10 18:01:07 UTC

[PR] Core: Cache manifest list files in manifest content cache [iceberg]

rahulsmahadev opened a new pull request, #16762:
URL: https://github.com/apache/iceberg/pull/16762

   ## Summary
   
   When `io.manifest.cache.enabled` is set, manifest files are served through `ContentCache`, but manifest **list** files are not — `BaseSnapshot.cacheManifests` reads the list with a raw `FileIO.newInputFile` call. Every freshly loaded `Snapshot` (table refresh, new table handle, streaming poll) therefore re-fetches the same immutable manifest-list file from object storage, even when the content cache is enabled and warm.
   
   This change routes the manifest-list read through the same content cache used for manifests:
   
   - `ManifestFiles.newInputFile(FileIO, ManifestListFile)` — package-private twin of the existing `newInputFile(FileIO, ManifestFile)` helper: wraps the input with `ContentCache.tryCache` when caching is enabled for the `FileIO`.
   - `BaseSnapshot.cacheManifests` uses it for the manifest-list read.
   
   Manifest lists are immutable and location-unique like manifests, so the existing cache keying and invalidation semantics apply unchanged. Encrypted manifest lists follow the same contract as manifests today: the `FileIO` (e.g. `EncryptingFileIO`) controls decryption, and caching behavior is identical to the manifest path.
   
   ## Test plan
   
   - New `TestManifestCaching.testManifestListCaching`: a freshly parsed snapshot loads the manifest list through the cache (miss + cache-size increase), and a second snapshot instance reading the same list is served from the cache (no new miss, hit count increases).
   - Updated `testPlanWithCache` expectations: with the change, each append commit also caches one manifest list (parent lists are read while committing, and the current snapshot's list while planning), so the cache holds `numFiles * 2` entries.
   - Verified locally: `TestManifestCaching` (6/6), `TestManifestListVersions`, `TestSnapshot`, `TestCommitReporting`, `TestManifestListEncryption`, plus spotless and checkstyle.
   


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Core: Cache manifest list files in manifest content cache [iceberg]

Posted by "szehon-ho (via GitHub)" <gi...@apache.org>.
szehon-ho closed pull request #16762: Core: Cache manifest list files in manifest content cache
URL: https://github.com/apache/iceberg/pull/16762


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Core: Cache manifest list files in manifest content cache [iceberg]

Posted by "singhpk234 (via GitHub)" <gi...@apache.org>.
singhpk234 commented on code in PR #16762:
URL: https://github.com/apache/iceberg/pull/16762#discussion_r3410103014


##########
core/src/main/java/org/apache/iceberg/ManifestFiles.java:
##########
@@ -562,6 +562,15 @@ private static ManifestFile copyManifestInternal(
     return writer.toManifestFile();
   }
 
+  static InputFile newInputFile(FileIO io, ManifestListFile manifestList) {

Review Comment:
   +1 on putting this to the ManifestListFiles, i believe its done to use manifest cache which is private static final in the ManifestFile
   https://github.com/apache/iceberg/blob/ce4d7d8973cbe57306ef4927fbafa6ca53b5982c/core/src/main/java/org/apache/iceberg/ManifestFiles.java#L73
   
   Also reusing the cache which strictly just caches ManifestFiles to cache ManifestLists seems a bit odd to me as they are not same. 
   
   if its absolutely required, we might wanna introduce a new cache for manifestLists or unify the cache saying iceberg metadata cache ?



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Core: Cache manifest list files in manifest content cache [iceberg]

Posted by "rahulsmahadev (via GitHub)" <gi...@apache.org>.
rahulsmahadev commented on code in PR #16762:
URL: https://github.com/apache/iceberg/pull/16762#discussion_r3390511880


##########
core/src/main/java/org/apache/iceberg/ManifestFiles.java:
##########
@@ -562,6 +562,15 @@ private static ManifestFile copyManifestInternal(
     return writer.toManifestFile();
   }
 
+  static InputFile newInputFile(FileIO io, ManifestListFile manifestList) {
+    InputFile input = io.newInputFile(manifestList);
+    if (cachingEnabled(io)) {

Review Comment:
   I wonder if its good practice to add a new knob here or use the existing one



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Core: Cache manifest list files in manifest content cache [iceberg]

Posted by "szehon-ho (via GitHub)" <gi...@apache.org>.
szehon-ho commented on code in PR #16762:
URL: https://github.com/apache/iceberg/pull/16762#discussion_r3409127893


##########
core/src/main/java/org/apache/iceberg/ManifestFiles.java:
##########
@@ -562,6 +562,15 @@ private static ManifestFile copyManifestInternal(
     return writer.toManifestFile();
   }
 
+  static InputFile newInputFile(FileIO io, ManifestListFile manifestList) {

Review Comment:
   Hi @rahulsmahadev , I was thinking , it seems weird to have ManifestList method on ManifestFiles.  Can we do this on ManifestLists.
   
   ```
   static List<ManifestFile> read(FileIO io, ManifestListFile manifestList) {
     return read(ManifestFiles.newInputFile(io, manifestList));
   }
   ```
   
   And then have basesnapshot:
   ```
   this.allManifests =
       ManifestLists.read(fileIO, new BaseManifestListFile(manifestListLocation, keyId));
   ```



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Core: Cache manifest list files in manifest content cache [iceberg]

Posted by "szehon-ho (via GitHub)" <gi...@apache.org>.
szehon-ho commented on code in PR #16762:
URL: https://github.com/apache/iceberg/pull/16762#discussion_r3409127893


##########
core/src/main/java/org/apache/iceberg/ManifestFiles.java:
##########
@@ -562,6 +562,15 @@ private static ManifestFile copyManifestInternal(
     return writer.toManifestFile();
   }
 
+  static InputFile newInputFile(FileIO io, ManifestListFile manifestList) {

Review Comment:
   Hi @rahulsmahadev , I was thinking , it seems weird to have public ManifestList method on ManifestFiles.  Can we do this on ManifestLists.
   
   ```
   static List<ManifestFile> read(FileIO io, ManifestListFile manifestList) {
     return read(ManifestFiles.newInputFile(io, manifestList));
   }
   ```
   
   And then have basesnapshot:
   ```
   this.allManifests =
       ManifestLists.read(fileIO, new BaseManifestListFile(manifestListLocation, keyId));
   ```



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Core: Cache manifest list files in manifest content cache [iceberg]

Posted by "szehon-ho (via GitHub)" <gi...@apache.org>.
szehon-ho closed pull request #16762: Core: Cache manifest list files in manifest content cache
URL: https://github.com/apache/iceberg/pull/16762


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Core: Cache manifest list files in manifest content cache [iceberg]

Posted by "rahulsmahadev (via GitHub)" <gi...@apache.org>.
rahulsmahadev commented on code in PR #16762:
URL: https://github.com/apache/iceberg/pull/16762#discussion_r3416969805


##########
core/src/main/java/org/apache/iceberg/ManifestFiles.java:
##########
@@ -562,6 +562,15 @@ private static ManifestFile copyManifestInternal(
     return writer.toManifestFile();
   }
 
+  static InputFile newInputFile(FileIO io, ManifestListFile manifestList) {

Review Comment:
   Done in 001a9f7. Moved `newInputFile(FileIO, ManifestListFile)` to `ManifestLists` and updated the call site in `BaseSnapshot`. The `ContentCache` stays in `ManifestFiles` since manifest files and manifest lists are both cached through it; `ManifestLists` just reaches back through the package-private `ManifestFiles.cachingEnabled` / `ManifestFiles.contentCache` helpers. PTAL.



##########
core/src/main/java/org/apache/iceberg/ManifestFiles.java:
##########
@@ -562,6 +562,15 @@ private static ManifestFile copyManifestInternal(
     return writer.toManifestFile();
   }
 
+  static InputFile newInputFile(FileIO io, ManifestListFile manifestList) {

Review Comment:
   Done in 001a9f7 — see [reply above](https://github.com/apache/iceberg/pull/16762#discussion_r3409127893). Right reading on the reason: kept the cache on `ManifestFiles` and just routed `ManifestLists.newInputFile` through it via the existing package-private helpers.



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Core: Cache manifest list files in manifest content cache [iceberg]

Posted by "szehon-ho (via GitHub)" <gi...@apache.org>.
szehon-ho commented on PR #16762:
URL: https://github.com/apache/iceberg/pull/16762#issuecomment-4736121191

   Merged, thanks @rahulsmahadev !  is there any doc about this cache, that we need to update?


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Core: Cache manifest list files in manifest content cache [iceberg]

Posted by "szehon-ho (via GitHub)" <gi...@apache.org>.
szehon-ho commented on PR #16762:
URL: https://github.com/apache/iceberg/pull/16762#issuecomment-4697330647

   Re-triggering CI


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Core: Cache manifest list files in manifest content cache [iceberg]

Posted by "szehon-ho (via GitHub)" <gi...@apache.org>.
szehon-ho merged PR #16762:
URL: https://github.com/apache/iceberg/pull/16762


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Core: Cache manifest list files in manifest content cache [iceberg]

Posted by "szehon-ho (via GitHub)" <gi...@apache.org>.
szehon-ho commented on PR #16762:
URL: https://github.com/apache/iceberg/pull/16762#issuecomment-4735317531

   re-trigger ci


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org