Skip to content

fix suffix range handling in cached object store get_opts#27529

Open
naruto-lgtm wants to merge 1 commit into
influxdata:mainfrom
naruto-lgtm:parquet-cache-suffix-range
Open

fix suffix range handling in cached object store get_opts#27529
naruto-lgtm wants to merge 1 commit into
influxdata:mainfrom
naruto-lgtm:parquet-cache-suffix-range

Conversation

@naruto-lgtm

Copy link
Copy Markdown

Closes #

Repro: read any cached parquet object with a suffix range (bytes=-N) through MemCachedObjectStore, then compare with the same read against the backing store. They disagree.

Cause: get_opts hand-rolls the GetRange to byte-offset conversion and maps Suffix(n) to 0..n, so it returns the first n bytes instead of the last n. The same match also errors on a bounded range whose end runs past the object rather than clamping it, which diverges from the ObjectStore contract that get_ranges/the inner store follow.

Fix: delegate to object_store's own GetRange::as_range(len), which implements the documented Suffix/Offset/Bounded semantics, so a cache hit returns the same bytes as the backing store. Added a regression test over all three range kinds.

  • I've read the contributing section of the project README.
  • Signed CLA (if not already signed).

@naruto-lgtm

Copy link
Copy Markdown
Author

any update?

1 similar comment
@naruto-lgtm

Copy link
Copy Markdown
Author

any update?

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.

1 participant