CASSANDRA-19988 Honor background_read_disk_access_mode across SSTable maintenance and streaming - #5143
Open
cheeeee wants to merge 1 commit into
Open
CASSANDRA-19988 Honor background_read_disk_access_mode across SSTable maintenance and streaming#5143cheeeee wants to merge 1 commit into
cheeeee wants to merge 1 commit into
Conversation
Route maintenance readers through the background read setting and retain the legacy YAML setting replacement. Use bounded aligned reads for direct streaming of physical component bytes, including partial compressed chunks. Keep buffered fallback and the existing zero-copy path for non-direct entire-SSTable streaming. CASSANDRA-19988 Generated-by: Claude (Anthropic)
cheeeee
force-pushed
the
CASSANDRA-19988-trunk
branch
from
September 11, 2026 22:50
cd631b4 to
e328bce
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CASSANDRA-19988: extend direct-I/O reads from compaction to the other background operations that scan
whole SSTables, and rename the setting accordingly.
Changes:
old key is still accepted and reported as deprecated). Java accessors are renamed with it; the
ticket's setting shipped in 6.0-alpha only.
background mode, as compaction already did.
StreamingFileReader, which under direct mode opens the file with ExtendedOpenOption.DIRECT and stages
reads in a 1 MiB buffer aligned to the filesystem block size (block size is looked up once per
directory and cached), handling unaligned section starts and the unaligned tail at end of file.
Checksums and compressed chunk boundaries are served from the staged bytes exactly as before.
from the page cache by the kernel, so under direct mode components are read through
StreamingFileReader and written in 64 KiB batches; when the direct open did not actually take effect
the reader is closed immediately and the zero-copy sendfile path is kept.
O_DIRECT with fcntl after opening and throws IOException when the kernel rejects it) or the block
size is unusable (0, not a power of two, or larger than the staging buffer), StreamingFileReader
falls back to a buffered channel and logs a rate-limited WARN naming the file and reason. The
streaming path inspects no errno values and probes no temporary file; scrub, verify and index builds
go through the pre-existing FileHandle.supportsDirectIO() check that compaction already used.
retention hint (F_NOCACHE) and that tmpfs accepts it without effect; NEWS.txt gets a deprecation
entry for the old key.
Testing:
across unaligned start/end boundaries of a file in the SSTable's data directory; compressed and
uncompressed partial streams reproduce the stored chunks/checksum slices; an entire-SSTable direct
stream reproduces every component of a compressed and an uncompressed SSTable.
unaligned read is rejected with EINVAL; on tmpfs O_DIRECT is accepted but all pages stay resident
(which is why the yaml calls it a no-op there); on a filesystem without O_DIRECT support the kernel
rejects the flag with EINVAL, which the JDK surfaces as the IOException the fallback catches.
foreground reads. Incoming (receive-side) streaming is not covered by this change.
CASSANDRA-19988