Conversation
4f6a408 to
6c83218
Compare
Move history mutations off compaction threads and shared maintenance schedulers. Return explicit completion, preserve failure inspection, and reject new diagnostic records when the bounded queue is full or shut down. Drain accepted history writes before storage teardown in production and distributed-instance lifecycles. CASSANDRA-19576 Generated-by: Claude (Anthropic)
6c83218 to
537185e
Compare
|
Withdrawing this patch. It does remove the stall: with the memtable pool exhausted and flush blocked, an unpatched But deferring the write to a dedicated thread does not remove the dependency, it moves it: that Compaction is a path that frees resources, and its last step allocates from the pool it is trying to |
CASSANDRA-19576: SystemKeyspace.updateCompactionHistory writes to system.compaction_history on the
compaction thread. When memtable memory is exhausted that write blocks until a flush frees space, so
compactions cannot complete and fall further behind.
Changes:
visible) with a bounded queue of 1000 records and AbortPolicy. When the queue is full or the executor
is shut down the newest record is dropped with a rate-limited WARN; the compaction thread never
blocks on the write and never runs it inline. History is diagnostic, so dropping a record is
preferred to stalling compaction (this is the trade-off the ticket proposes).
write failure or rejection. Because the write is deferred, the rowsMerged and compaction_properties
maps are copied before submission.
(cassandra.drain_executor_timeout_ms) after CompactionManager.forceShutdown and before the system
tables are flushed and the commitlog is shut down, so accepted records are not lost and no history
mutation is still running while the commitlog closes. If draining exceeds the timeout, drain fails
rather than proceeding. The in-JVM dtest Instance.shutdown, which does not go through drain, stops
the writer the same way.
(CompactionTaskTest, nodetool CompactionHistoryTest, SystemKeyspaceTest).
Testing:
the next submission to be rejected with a failed future while the accepted ones complete in FIFO
order; shutdownAndWait drains accepted records and rejects submissions made afterwards.
not change the stored row.
Instance.shutdown stops the writer and passes the harness thread-leak check.
contract and the shutdown ordering, not the original stall.
CASSANDRA-19576