apache/cassandra · error · PreviewRepairConflictWithIncrementalRepairException
SSTable %s is marked pending for non-finalized incremental r
Error message
SSTable %s is marked pending for non-finalized incremental repair session %s, failing preview repair
What it means
PreviewKind's repaired-check (used when previewing repair, e.g. preview-repair-repaired or parent-repair preview) throws PreviewRepairConflictWithIncrementalRepairException when an SSTable is marked pending for an incremental repair LocalSession that is neither FINALIZED nor FAILED. Preview repair cannot meaningfully classify such SSTables — they belong to an in-flight incremental repair — so the operation fails fast instead of returning misleading results.
Source
Thrown at src/java/org/apache/cassandra/streaming/PreviewKind.java:95
{
return predicate;
}
private static class PreviewRepairedSSTablePredicate implements Predicate<SSTableReader>
{
public boolean apply(SSTableReader sstable)
{
// grab the metadata before checking pendingRepair since this can be nulled out at any time
StatsMetadata sstableMetadata = sstable.getSSTableMetadata();
if (sstableMetadata.pendingRepair != null)
{
LocalSession session = ActiveRepairService.instance().consistent.local.getSession(sstableMetadata.pendingRepair);
if (session == null)
return false;
else if (session.getState() == ConsistentSession.State.FINALIZED)
return true;
else if (session.getState() != ConsistentSession.State.FAILED)
throw new PreviewRepairConflictWithIncrementalRepairException(String.format("SSTable %s is marked pending for non-finalized incremental repair session %s, failing preview repair", sstable, sstableMetadata.pendingRepair));
}
return sstableMetadata.repairedAt != ActiveRepairService.UNREPAIRED_SSTABLE;
}
}
}
View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Wait for the incremental repair session to reach FINALIZED or FAILED (check nodetool netstats / system.repairs) then retry the preview.
- Abort or let the in-flight incremental repair finish before running preview repair on the same tables.
- For genuinely stuck sessions, fail the session (nodetool failrepairedata / consistent repair management) so SSTables are released, then re-run preview; avoiding mixing preview and incremental repair on the same ranges prevents recurrence.
Example fix
// before nodetool repair -pr keyspace1 --preview # while incremental repair running // after # wait for incremental repair completion nodetool repair -pr keyspace1 --preview
Defensive patterns
Strategy: retry
Validate before calling
// ensure no incremental repair session is active on target tables
for (SSTableReader s : table.getLiveSSTables())
if (s.isPendingRepair()) throw new IllegalStateException("pending incremental repair SSTables present"); Try / catch
try { repair(previewKind); } catch (PreviewRepairConflictWithIncrementalRepairException e) { waitUntilSessionsSettled(); repair(previewKind); } Prevention
- Never run preview repair concurrently with incremental repair on the same ranges
- Monitor system.repairs and wait for FINALIZED/FAILED before previewing
- Alert on stuck incremental repair sessions that leak pendingRepair SSTables
When it happens
Trigger: Running nodetool repair --preview (or validate/preview kinds) on ranges containing SSTables with pendingRepair set from a still-active incremental repair session; mixing preview repair and incremental repair concurrently on overlapping ranges.
Common situations: Operators running preview after cancelling but before incremental repair sessions fully fail/finalize; scheduled preview repairs overlapping incremental repair windows; leaked pendingRepair states from crashed incremental repair sessions.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- Prepare phase failed because it encountered legacy sstables
- You can't mix repaired and unrepaired data in a compaction
- You can't compact sstables from different pending repair ses
- Could not reference sstables
- Prepare phase for incremental repair session %s has failed b
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/be1806b3e507289d.
Report an issue: GitHub.