{"record":{"id":"1e352179118ea0e5","repo":"apache/cassandra","slug":"cannot-specify-a-repair-as-both-paxos-only-and-acc","errorCode":null,"errorMessage":"Cannot specify a repair as both paxos only and accord only","messagePattern":"Cannot specify a repair as both paxos only and accord only","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/repair/RepairCoordinator.java","lineNumber":296,"sourceCode":"        try\n        {\n            runMayThrow();\n        }\n        catch (SkipRepairException e)\n        {\n            skip(e.getMessage());\n        }\n        catch (Throwable e)\n        {\n            notifyError(e);\n            fail(e.getMessage());\n        }\n    }\n\n    private static void validate(RepairOption options, List<ColumnFamilyStore> columnFamilies)\n    {\n        if (options.paxosOnly() && options.accordOnly())\n            throw new IllegalArgumentException(\"Cannot specify a repair as both paxos only and accord only\");\n\n        for (ColumnFamilyStore cfs : columnFamilies)\n        {\n            TableMetadata metadata = cfs.metadata();\n            if (options.paxosOnly() && !metadata.supportsPaxosOperations())\n                throw new IllegalArgumentException(String.format(\"Cannot run paxos only repair on %s.%s, which isn't configured for paxos operations\", cfs.keyspace.getName(), cfs.name));\n\n            if (options.accordOnly() && !metadata.requiresAccordSupport())\n                throw new IllegalArgumentException(String.format(\"Cannot run accord only repair on %s.%s, which isn't configured for accord operations\", cfs.keyspace.getName(), cfs.name));\n        }\n    }\n\n    private void runMayThrow() throws Throwable\n    {\n        state.phase.setup();\n        ctx.repair().recordRepairStatus(state.cmd, ParentRepairStatus.IN_PROGRESS, ImmutableList.of());\n\n        List<ColumnFamilyStore> columnFamilies = getColumnFamilies();","sourceCodeStart":278,"sourceCodeEnd":314,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/repair/RepairCoordinator.java#L278-L314","documentation":"RepairCoordinator.validate rejects repair options that set both paxos-only and accord-only modes, since a single repair cannot target both consensus protocols exclusively. The request is rejected with IllegalArgumentException before any repair work starts.","triggerScenarios":"Calling repair (nodetool/JMX/StorageService.repairAsync) with RepairOption where both PaxosOnly and AccordOnly flags are set to true.","commonSituations":"Scripting repair calls that concatenate flags (e.g. --paxos-only --accord-only) from separate config variables without checking for overlap.","solutions":["Set only one of paxos-only or accord-only in the repair request.","Fix the calling script/tooling to make the two options mutually exclusive.","If you need both protocol scopes, issue two separate repair calls."],"exampleFix":"// before\nopts.put(RepairOption.PAXOS_ONLY, \"true\"); opts.put(RepairOption.ACCORD_ONLY, \"true\");\n// after\nopts.put(RepairOption.PAXOS_ONLY, \"true\"); // or ACCORD_ONLY, not both","handlingStrategy":"validation","validationCode":"if (paxosOnly && accordOnly) throw new IllegalArgumentException(\"choose either --paxos-only or --accord-only\");\n","typeGuard":null,"tryCatchPattern":"try { repairAsync(ks, options); } catch (IllegalArgumentException e) { usage(\"Invalid repair options: \" + e.getMessage()); }","preventionTips":["Make repair-option builders reject mutually exclusive flags at construction","Keep flag plumbing in one place in tooling scripts","Validate options client-side before calling JMX/StorageService"],"tags":["repair","validation","cli"],"backgroundTag":"mutually-exclusive-flags","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"}