Skip to content

CASSANDRA-19597: Isolate SystemKeyspace post-flush tasks on dedicated executor - #5142

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

CASSANDRA-19597: Isolate SystemKeyspace post-flush tasks on dedicated executor#5142
cheeeee wants to merge 1 commit into
apache:trunkfrom
cheeeee:CASSANDRA-19597-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. Isolation and shutdown behavior still require clean, discriminating execution; this does not isolate all system I/O from user flush writers.

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: 3a3290709b9376060b67d378662a38f55bb98ec8.

…DRA-19597)

MemtablePostFlush previously serialized post-flush tasks across all keyspaces
and tables using a single static single-threaded sequential executor.
When a user table experiences heavy flushes with slow IntervalTree construction
and compactions, it blocks MemtablePostFlush. Subsequent flushes for SystemKeyspace
(e.g., system.local, system.peers, Gossip node removal, cluster metadata) get
queued behind user tables. This caused Gossip to pause, heartbeats to be missed,
and nodes to falsely mark each other down.

This patch:
1. Adds a dedicated systemPostFlushExecutor (SystemMemtablePostFlush) for local
   system keyspaces (SchemaConstants.isLocalSystemKeyspace), ensuring system and
   gossip tasks are never blocked by slow user table flushes.
2. Preserves strict FIFO sequential post-flush ordering within each keyspace domain.
3. Shuts down cleanly and in parallel using ExecutorUtils.shutdownAndWait,
   avoiding sequential timeout accumulation.

Fixes: CASSANDRA-19597
@cheeeee
cheeeee force-pushed the CASSANDRA-19597-trunk branch from f90d380 to 3a32907 Compare September 11, 2026 01:06
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