Full ERROR Message Example
ERROR Inc-Repair-prepare-executor-0 2020-03-18 10:35:21,580 LocalSessions.java:654 - Prepare phase for incremental repair session 509a02a0-691d-11ea-bc5c-679a2e29d11c failed.
What does this ERROR message mean?
This ERROR message means that an sstable was flagged by the incremental repair as in a prepare state, but something went wrong and the prepare and repair session failed.
Why does this ERROR occur?
The incremental repair process is now supervised by a transaction to guarantee its consistency. In the “Prepare phase”, anticompaction is performed before the Merkle trees are computed, and the candidate SSTables will be marked as pending a specific repair. note that they are not marked as repaired just yet to avoid inconsistencies in case the repair session fails.
If a candidate SSTable is currently part of a running compaction, Cassandra will try to cancel that compaction and wait up to a minute. If the compaction successfully stops within that time, the SSTable will be locked for future anticompaction, otherwise the whole prepare phase and the repair session will fail.
How do you fix this ERROR?
Some investigation will likely be required to determine why the repair or compaction failed. You will likely need to review the system.log to find the node's behavior before/around the time the error occurred. If you see compaction issues, you may need to tune your compaction to increase the throughput or number of concurrent compactors. This will vary on a case-by-case basis though.
A general workaround for this type of repair error is to disable incremental repair, perform a standard repair on the sstables included in the error and then re-enable incremental repair.