Skip to content

fix(layers/foyer): preserve read args while filling full-object cache#7718

Open
tonghuaroot wants to merge 1 commit into
apache:mainfrom
tonghuaroot:fix-foyer-cache-fill-read-args
Open

fix(layers/foyer): preserve read args while filling full-object cache#7718
tonghuaroot wants to merge 1 commit into
apache:mainfrom
tonghuaroot:fix-foyer-cache-fill-read-args

Conversation

@tonghuaroot

@tonghuaroot tonghuaroot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #7686.

Rationale for this change

FullReader::read_full_object filled the full-object cache with stat(OpStat::default()) and read(OpRead::default()), dropping the reader's OpRead. A versioned read then fetched and cached latest content under a versioned key, and conditional options (if_match, ...) were bypassed on the cache-fill path. The fallback paths already use self.args.clone(); this aligns the cache-fill path with them.

What changes are included in this PR?

  • Cache-fill read now uses the reader's OpRead instead of the default.
  • Cache-fill stat derives its conditions (version, if-match, if-none-match, if-modified-since, if-unmodified-since) from the reader's OpRead.
  • Added test_cache_fill_preserves_read_args, which fails on the old default-args path and verifies the inner accessor observes version and if_match.

Are there any user-facing changes?

No public API change. The full-object cache now honors versioned and conditional read semantics on cache miss.

The full-object cache fill called `stat` and `read` with default args,
so versioned and conditional reads stored latest content under a
versioned cache key. Derive the stat args from the reader's `OpRead`
and pass the original read args, matching the fallback paths.

Closes apache#7686
@tonghuaroot tonghuaroot requested a review from Xuanwo as a code owner June 10, 2026 05:42
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. releases-note/fix The PR fixes a bug or has a title that begins with "fix" labels Jun 10, 2026
@tonghuaroot

Copy link
Copy Markdown
Contributor Author

The failing HDFS behavior test looks unrelated to this change (it only touches FoyerLayer) — likely the same flakiness as #7577. Could a maintainer retrigger the job?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/fix The PR fixes a bug or has a title that begins with "fix" size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: FoyerLayer ignores read args while filling full-object cache

1 participant