You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "samueldlightfoot (via GitHub)" <gi...@apache.org> on 2026/09/14 20:38:38 UTC
Re: [PR] 21671 direct io + readahead exception fix [cassandra]
samueldlightfoot commented on code in PR #5152:
URL: https://github.com/apache/cassandra/pull/5152#discussion_r4009375562
##########
src/java/org/apache/cassandra/cache/ChunkCache.java:
##########
@@ -260,7 +260,11 @@ public void invalidate(long position)
@Override
public Rebufferer instantiateRebufferer(boolean isScan)
{
- return this;
+ // A scan (compaction, index build) reads each chunk once and must not pollute the cache with
+ // one-shot chunks that evict hot data. Delegate to the source so the scan bypasses the cache and
+ // uses its own read-ahead buffer instead. For an Mmap source this also bypasses the chunk cache,
+ // which is correct: mmap data already lives in the OS page cache, so the chunk cache only duplicates it.
+ return isScan ? source.instantiateRebufferer(true) : this;
Review Comment:
This will also bypass the chunk cache for partition range reads which may fall under re-use.
An option to split is to swap the scan flag with an enum:
https://github.com/samueldlightfoot/cassandra/commit/75d827588e9ffad3a1aea028174101b70825e841
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org