Skip to content

CASSANDRA-21511: Fix page cache eviction for ranges larger than 2 GiB#4935

Open
Runtian wants to merge 1 commit into
apache:trunkfrom
Runtian:CASSANDRA-21511-trunk
Open

CASSANDRA-21511: Fix page cache eviction for ranges larger than 2 GiB#4935
Runtian wants to merge 1 commit into
apache:trunkfrom
Runtian:CASSANDRA-21511-trunk

Conversation

@Runtian

@Runtian Runtian commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

NativeLibrary.trySkipCache splits ranges larger than Integer.MAX_VALUE before passing them to posix_fadvise, but incorrectly moved the offset backward after each chunk, so page-cache eviction for ranges over 2 GiB targeted the wrong offsets. Advance the offset so all chunks cover consecutive forward file ranges, and add deterministic unit coverage for large, boundary, nonzero-offset, and whole-file ranges.

JIRA: https://issues.apache.org/jira/browse/CASSANDRA-21511

NativeLibrary.trySkipCache splits ranges larger than Integer.MAX_VALUE
before passing them to posix_fadvise, but incorrectly moved the offset
backward after each chunk. Advance the offset so all chunks cover
consecutive forward file ranges, and add deterministic unit coverage for
large, boundary, nonzero-offset, and whole-file ranges.
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