5be57829b03ef980933ba52ecc0549787f653da4 | Author: Szymon Miężał <szymon.miezal@datastax.com>
| 2023-11-08 17:41:45+01:00
Backport CASSANDRA-16418 to 3.x
When a node is decommissioned, it triggers data transfer to other nodes.
During this transfer process, receiving nodes temporarily hold token ranges in a pending state.
However, the current cleanup process doesn't account for these pending ranges when calculating token ownership,
leading to inadvertent cleanup of data already stored in SSTables.
To address this issue, this patch introduces two changes.
Firstly, it backports CASSANDRA-16418, introducing a preventive check in `StorageService#forceKeyspaceCleanup`.
This check disallows the initiation of cleanup when a node contains any pending ranges for the requested keyspace.
Secondly, it reintroduces a similar condition to test for the existence of pending ranges in `CompactionManager#performCleanup`.
This ensures the safety of this API as well.
Patch by Szymon Miezal; reviewed by Brandon Williams, Jacek Lewandowski for CASSANDRA-18824
Co-authored-by: Szymon Miezal <szymon.miezal@datastax.com>
Co-authored-by: Jacek Lewandowski <lewandowski.jacek@gmail.com>