Skip to content

CASSANDRA-19569: Fix currentlyOpenedEarlyAt not updating in offline SSTableRewriter - #5140

Open
cheeeee wants to merge 1 commit into
apache:trunkfrom
cheeeee:CASSANDRA-19569-trunk
Open

CASSANDRA-19569: Fix currentlyOpenedEarlyAt not updating in offline SSTableRewriter#5140
cheeeee wants to merge 1 commit into
apache:trunkfrom
cheeeee:CASSANDRA-19569-trunk

Conversation

@cheeeee

@cheeeee cheeeee commented Sep 10, 2026

Copy link
Copy Markdown

Status: changes requested — not ready to merge

Source review found no introduced production defect; previous performance and runtime-verification claims are not established by the available evidence.

Verification correction

Earlier descriptions overstated correctness and/or test coverage. Those claims are withdrawn. AI-assisted source review has been performed; this is not maintainer approval. Previously mixed build artifacts are not accepted as verification evidence. Corrective changes and clean, targeted verification are in progress; the published head has not yet been replaced.

Published head under review: db95802f011b1604310bdf4edb073493828056c9.

…ASSANDRA-19569)

In SSTableRewriter.maybeReopenEarly(DecoratedKey key), the offline branch
(transaction.isOffline()) invoked reader.trySkipFileCacheBefore(key) for each
original reader when writer.getFilePointer() - currentlyOpenedEarlyAt > preemptiveOpenInterval,
but failed to update currentlyOpenedEarlyAt = writer.getFilePointer().

As a result, once the written data exceeded the 50MB preemptiveOpenInterval,
the condition remained permanently true for every subsequent row, calling
trySkipFileCacheBefore() on every single partition for the rest of the file.
This caused a massive storm of open(), fadvise64(POSIX_FADV_DONTNEED), and close()
system calls, degrading sstableupgrade and offline rewrite throughput to < 0.5 MB/s
on fast storage.

Added discriminating regression test testOfflinePreemptiveIntervalAdvancesPosition
in SSTableRewriterTest verifying position advance and clean execution.

Fixes: CASSANDRA-19569
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