Skip to content

CASSANDRA-21609: Guarantee postFlush latch decrement on flush failure - #5150

Closed
cheeeee wants to merge 1 commit into
apache:trunkfrom
cheeeee:CASSANDRA-21609-trunk
Closed

CASSANDRA-21609: Guarantee postFlush latch decrement on flush failure#5150
cheeeee wants to merge 1 commit into
apache:trunkfrom
cheeeee:CASSANDRA-21609-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. The finally-block fix still needs a clean failure-injection test; it does not cover setup failures before the try block.

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: c70f180c8d1e59b561c36a00219c0c46b6d6c23e.

In ColumnFamilyStore.Flush.run(), when a memtable flush failed, the catch
block invoked JVMStabilityInspector.inspectThrowable(t) before assigning
postFlush.flushFailure and before decrementing postFlush.latch.

If inspectThrowable() threw an exception (e.g. OutOfMemoryError, disk full
ENOSPC error, or security exception), execution aborted before reaching
postFlush.latch.decrement(). Because callers of forceBlockingFlush() and
other flush synchronization points wait on postFlush.latch, all waiting threads
were stranded indefinitely in WAITING state, causing an unrecoverable node hang.

This patch:
1. Records postFlush.flushFailure = t before inspecting the throwable.
2. Moves postFlush.latch.decrement() into a finally block, ensuring that
   waiting threads are guaranteed to be unblocked regardless of any exception
   thrown during failure inspection.

Fixes: CASSANDRA-21609
@cheeeee

cheeeee commented Sep 11, 2026

Copy link
Copy Markdown
Author

Closing: CASSANDRA-21609 is assigned to its reporter and has a patch available.

@cheeeee cheeeee closed this Sep 11, 2026
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