Skip to content

io: reduce redundant snapshot metadata requests - #1572

Merged
JingsongLi merged 3 commits into
apache:mainfrom
YannByron:codex/r4-snapshot-io
Dec 2, 2026
Merged

JingsongLi merged 3 commits into
apache:mainfrom
YannByron:codex/r4-snapshot-io

Conversation

@YannByron

@YannByron YannByron commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Snapshot discovery makes redundant metadata requests on object storage. Uncached snapshot loads check existence before reading an already known object path. For Jindo-backed OSS, filesystem-style checks of a missing snapshot may additionally probe a directory and the bucket root.

Brief change log

  • Read uncached snapshot objects directly. Translate only NotFound into SnapshotNotExist; retain permission/service errors and JSON/id validation.
  • Retain remote existence checks when the local block cache is enabled so a cached body cannot revive an externally expired snapshot.
  • Add a private file-only existence path for known snapshot files. On Jindo SDKs providing the complete object-metadata API, use object metadata instead of filesystem status. SDKs without these symbols retain the existing filesystem check.
  • Keep generic file/directory APIs unchanged. File-only operators are cached separately per bucket so their semantics cannot leak into directory checks.
  • Run the new SDK regression in the existing Linux Jindo CI job alongside the existing SDK test.

Tests

  • RED: the new uncached-snapshot HTTP regression fails on the base implementation with [HEAD, GET] instead of [GET].
  • cargo +1.95.0 test --locked --offline -p paimon --features storage-jindo --lib table::snapshot_manager: 27 passed, including remote expiration of a populated local cache and REST error behavior.
  • ... table::time_travel: 24 passed; ... io::file_io: 86 passed; ... io::storage_jindo: 12 passed (the SDK-specific test is run explicitly below).
  • Real PyJindoSDK 6.10.4 against a local HTTP OSS fixture on macOS: 1 passed, process exit 0. Checks one HEAD for existing, empty, missing, and directory-only paths; preserves 403/503 errors; generic missing-path checks still make three requests. Simulating unavailable object-metadata capability in the same SDK verifies fallback to the original three-request filesystem path. An actual older SDK binary was not tested.
  • SDK test teardown drains the existing teardown queue before exit. The Linux CI Jindo job now includes this regression.
  • cargo +1.95.0 fmt --all --check and git diff --check: passed.

These are correctness and request-count tests using a local HTTP fixture, not a new OSS latency benchmark.

API and Format

No public API, storage-format, or configuration changes. The file-only Jindo operator initializes a separate SDK client once per bucket; request-count improvements should not be interpreted as a measured cold-start speedup.

Documentation

The cache-expiration safeguard and optional SDK capability fallback are explained in code. No new end-to-end benchmark speedup is claimed by this PR.

CI follow-up

The cached-snapshot regression now uses the temporary directory's native absolute path. Constructing file:C:\... produced an invalid Windows filename before the expiration assertions could run. The cache-population and external-deletion assertions are unchanged.

The two get-snapshot regressions and two existing Windows path-normalization tests pass locally on macOS; the actual Windows result is checked by the new CI run. The prior macOS job was canceled by fail-fast after the Windows failure, not by an independent macOS test failure.

biyan and others added 2 commits December 1, 2026 20:23
Read known snapshot objects directly when no local block cache is active.
Map only missing-object errors to SnapshotNotExist, preserve permission and
service failures, and retain existence checks for cached snapshots so
external expiration cannot revive a deleted snapshot from the cache.

Co-Authored-By: Codex <noreply@anthropic.com>
AI-Model: gpt-6
Co-Authored-By: Codex <noreply@ai-tool.com>
AI-Contributed/Feature: 155/155
AI-Contributed/UT: 0/0
Use the optional Jindo object-metadata API for private file-only existence
checks. Keep generic directory semantics, propagate storage errors, and
fall back to filesystem status when the SDK lacks the complete capability.
Retain the SDK library through result cleanup and check object sizes.

Add real SDK HTTP request and fallback coverage to the existing CI job.

Co-Authored-By: Codex <noreply@anthropic.com>
AI-Model: gpt-6
Co-Authored-By: Codex <noreply@ai-tool.com>
AI-Contributed/Feature: 335/335
AI-Contributed/UT: 0/0
@JingsongLi

Copy link
Copy Markdown
Contributor

[P2] Use a portable table path in the cached-snapshot regression. The Windows unit job fails in test_get_snapshot_does_not_revive_deleted_cached_snapshot at its first snapshot read. The fixture builds file:C:\Users\... by prefixing the native temporary path with file:. The filesystem resolver recognizes file:/... and bare Windows drive paths, so the resulting filename fails with invalid filename before the test reaches cache expiration. Use the native absolute path directly or build a proper file URL. The new FileIO test already uses native absolute paths and passed in the same Windows job. The local Jindo SDK test and the Linux Jindo and Rust integration jobs passed. Fixture · Failing Windows job

Pass the temporary directory as a native absolute path. Prefixing a Windows
drive path with file: creates an invalid filename before the regression can
verify that externally expired snapshots are not revived from local cache.

Co-Authored-By: Codex <noreply@anthropic.com>
AI-Model: gpt-6
Co-Authored-By: Codex <noreply@ai-tool.com>
AI-Contributed/Feature: 3/3
AI-Contributed/UT: 0/0
@JingsongLi
JingsongLi merged commit 94c356c into apache:main Dec 2, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants