{"record":{"id":"00c51d2119376556","repo":"apache/cassandra","slug":"unable-to-commit-rack-changes-r","errorCode":null,"errorMessage":"Unable to commit rack changes: {r}","messagePattern":"Unable to commit rack changes: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/StorageService.java","lineNumber":5863,"sourceCode":"        return DatabaseDescriptor.getPaxosRepairRaceWait();\n    }\n\n    public void alterTopology(String changes)\n    {\n        Map<NodeId, Location> updates = AlterTopology.parseArgs(changes, ClusterMetadata.current().directory);\n        logger.info(\"Received request to modify rack assignments. Proposed changes: {}\", updates);\n        if (updates.isEmpty())\n            return;\n\n        AlterTopology transform = new AlterTopology(updates, ClusterMetadataService.instance().placementProvider());\n        ClusterMetadataService.instance()\n                              .commit(transform,\n                                      m -> {\n                                          logger.info(\"Rack changes committed successfully\");\n                                          return m;\n                                      },\n                                      (c, r) -> {\n                                          throw new IllegalArgumentException(\"Unable to commit rack changes: \" + r);\n                                      });\n    }\n\n    @Override\n    public List<String> getTablesForKeyspace(String keyspace)\n    {\n        return Keyspace.open(keyspace).getColumnFamilyStores().stream().map(cfs -> cfs.name).collect(Collectors.toList());\n    }\n\n    @Override\n    public void validateAndRepairPeersMetadata()\n    {\n        SystemPeersValidator.validateAndRepair(ClusterMetadata.current());\n    }\n\n    @Override\n    public List<String> mutateSSTableRepairedState(boolean repaired, boolean preview, String keyspace, List<String> tableNames)\n    {","sourceCodeStart":5845,"sourceCodeEnd":5881,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/StorageService.java#L5845-L5881","documentation":"Thrown by StorageService when committing a rack/topology transformation via ReactiveTransformationResult.commit fails; the failure reason r is appended. It wraps an exception caught while persisting the DC/rack placement change.","triggerScenarios":"Calling the rack-change API (e.g. moveNode/assassinate-era topology transforms or RackInferringSnitch updates) where the underlying transformation commit encounters a conflict or internal error, so the failure callback rethrows IllegalArgumentException.","commonSituations":"Concurrent topology changes conflicting with each other; incoherent cluster state during DC/rack migration; node leaving/joining while the rack change is applied.","solutions":["Read the appended reason and fix the underlying transformation failure it reports.","Retry the rack change once the cluster reaches schema/ownership agreement and no other topology operations are in flight.","Check logs around the commit for the original exception and validate the proposed topology before reapplying."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Ensure no other topology operations are in flight\n// nodetool netstats / compactionstats clean; cluster at schema agreement","typeGuard":null,"tryCatchPattern":"try { rackChangeApi.commit(); }\ncatch (IllegalArgumentException e) { logger.warn(\"rack commit failed: {}\", e.getMessage()); /* inspect reason, resolve conflict, retry */ }","preventionTips":["Apply one topology change at a time","Verify rack/DC assignments in cassandra-rackdc.properties before committing","Check logs for the underlying transformation failure"],"tags":["cassandra","topology","rack","commit-failure"],"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"}