Visitar URL original
Process-global manifest cache is keyed only on manifest_path · Issue #3978 · apache/iceberg-python · GitHub
Skip to content

Process-global manifest cache is keyed only on manifest_path #3978

Description

@sungwy

pyiceberg/manifest.py holds a module-level cache:

_manifest_cache = _ManifestCache()

Its docstring describes it accurately: "Process-wide ManifestFile cache keyed by manifest_path." The key is the path string alone — no catalog, table, session, or tenant forms part of it.

def get_or_cache(self, manifest_file: ManifestFile) -> ManifestFile:
    ...
    manifest_path = manifest_file.manifest_path
    if manifest_path in self._cache:
        return self._cache[manifest_path]
    self._cache[manifest_path] = manifest_file
    return manifest_file

On a hit it returns the cached object and discards the one just read. Since read_manifest_list constructs ManifestFile objects from the entries of a manifest list rather than by reading each manifest file, the cached object reflects whatever the first manifest list to name that path declared — including its partition summaries, counts and sequence numbers.

Two tables in the same process that reference the same manifest_path therefore share one ManifestFile, and the first read wins. Because those fields drive scan pruning, a stale or mismatched entry changes which files a scan considers.


Issue investigation generated via claude, reviewed by Sung, Kevin, Fokko.

Activity

  1. added a commit that references this issue on Sep 17, 2026
    3f53a70
  2. Fokko commented on Sep 17, 2026

    @Fokko
    Contributor

    I'm not sure if this is a real bug. Sharing manifests between tables is quite controversial, since you don't know who owns the manifest file. If either table expires the manifest, the other table will be bricked.

  3. added 2 commits that reference this issue on Sep 18, 2026
    7a51aea
    8f1d01e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions