{"record":{"id":"e07157cc230e3698","repo":"apache/cassandra","slug":"failed-setting-istransient-to-b-on-s-istransien","errorCode":null,"errorMessage":"Failed setting isTransient to %b on %s (isTransient is %b)","messagePattern":"Failed setting isTransient to %b on (.+?) \\(isTransient is %b\\)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/compaction/CompactionStrategyManager.java","lineNumber":1537,"sourceCode":"                // if there was an exception mutating repairedAt, we should still notify for the\n                // sstables that we were able to modify successfully before releasing the lock\n                cfs.getTracker().notifySSTableRepairedStatusChanged(changed);\n            }\n            finally\n            {\n                writeLock.unlock();\n            }\n        }\n    }\n\n    private static void verifyMetadata(SSTableReader sstable, long repairedAt, TimeUUID pendingRepair, boolean isTransient)\n    {\n        if (!Objects.equals(pendingRepair, sstable.getPendingRepair()))\n            throw new IllegalStateException(String.format(\"Failed setting pending repair to %s on %s (pending repair is %s)\", pendingRepair, sstable, sstable.getPendingRepair()));\n        if (repairedAt != sstable.getRepairedAt())\n            throw new IllegalStateException(String.format(\"Failed setting repairedAt to %d on %s (repairedAt is %d)\", repairedAt, sstable, sstable.getRepairedAt()));\n        if (isTransient != sstable.isTransient())\n            throw new IllegalStateException(String.format(\"Failed setting isTransient to %b on %s (isTransient is %b)\", isTransient, sstable, sstable.isTransient()));\n    }\n\n    public CleanupSummary releaseRepairData(Collection<TimeUUID> sessions)\n    {\n        List<CleanupTask> cleanupTasks = new ArrayList<>();\n        readLock.lock();\n        try\n        {\n            for (PendingRepairManager prm : Iterables.concat(pendingRepairs.getManagers(), transientRepairs.getManagers()))\n                cleanupTasks.add(prm.releaseSessionData(sessions));\n        }\n        finally\n        {\n            readLock.unlock();\n        }\n\n        CleanupSummary summary = new CleanupSummary(cfs, Collections.emptySet(), Collections.emptySet());\n","sourceCodeStart":1519,"sourceCodeEnd":1555,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/compaction/CompactionStrategyManager.java#L1519-L1555","documentation":"The isTransient branch of verifyMetadata: when repair operations set the transient flag on an sstable (used by repaired-data tracking and incremental repair with transient repairs), the code verifies sstable.isTransient() afterwards and throws IllegalStateException if the flag does not equal the requested value. The transient metadata write failed or was overwritten concurrently.","triggerScenarios":"mutateRepaired(..., isTransient) invoked during transient/incremental repair transitions (promote or demote of transient sstables) with a concurrent sstable lifecycle operation changing isTransient before verification.","commonSituations":"Transient repair racing with compaction that merges transient sstables into non-transient output; concurrent repair finalization; tooling toggling transient state while repair runs.","solutions":["Re-run the repair (transient flag will be set again in a consistent pass)","Retry after in-flight compactions/repairs on the table settle","Avoid concurrent repairs and user-defined compactions during transient repair finalization","If reproducible without concurrency, file a Cassandra bug including sstablemetadata for the sstable"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"boolean current = sstable.isTransient();\nif (current == desiredIsTransient) return; // nothing to mutate, skip verification path","typeGuard":null,"tryCatchPattern":"try { mutateTransientAndVerify(sstable, isTransient); }\ncatch (IllegalStateException e) {\n  logger.warn(\"transient flag race on {} - repair will retry\", sstable, e);\n}","preventionTips":["Do not interleave transient repair with user-defined compaction on the same sstables","Check sstable.isTransient() before mutating to avoid redundant writes","Ensure transient repair finalization runs under the compaction strategy read lock","Re-run repair after any transient metadata verification failure"],"tags":["repair","transient-repair","race-condition","sstable-metadata"],"backgroundTag":"invalid-state-transition","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}