paimon icon indicating copy to clipboard operation
paimon copied to clipboard

[Bug] PyPaimon fast-forward can read a stale cached snapshot on Windows

Open skyyyy955 opened this issue 1 week ago • 0 comments

Search before asking

  • [x] I searched existing issues and pull requests for fast-forward cache invalidation and Windows path handling.

Paimon version

master at d11fd9b38b7ec482a5835f00048d512000122b98 (2.2-SNAPSHOT).

Compute Engine

PyPaimon on Windows with Python 3.10.11, PyArrow 19.0.1, and the Python execution backend. The tests use the local filesystem and exercise the memory and disk caches separately.

Minimal reproduce step

From paimon-python in that checkout, run the two existing filesystem catalog tests.

python -B -m pytest -q -p no:cacheprovider pypaimon/tests/filesystem_catalog_branch_test.py -k "fast_forward_with_memory_cache or fast_forward_with_disk_cache"

Both tests write to a local table and branch, warm the cache, fast-forward main, and append another row. The append reuses the ID of a snapshot that fast-forward removed. Tests

What doesn't meet your expectations?

Reading main after the append should return IDs [1, 2, 3, 4, 7]. I get [1, 2, 3, 5, 6], the rows from the old main snapshot.

Anything else?

The cache looks up snapshot-3 using the path built from the Windows warehouse string. Fast-forward invalidates it using the forward-slash spelling returned by the directory listing. The two strings point to the same file and produce different cache keys. In the disk test, all 10 old blocks were still on disk after invalidation, and the next read hit them. Both tests pass when I supply the same warehouse path with forward slashes.

#10980 added metadata replacement and invalidation during fast-forward. This case occurs later when a new append reuses a removed snapshot ID. Fast-forward invalidation · Cache keys

Are you willing to submit a PR?

  • [x] I'm willing to submit a PR!

I'd like to make invalidation use the same snapshot path as reads and cover both cache modes in the regression test. Could you assign this issue to me?

skyyyy955 avatar Nov 23 '26 08:11 skyyyy955