{"record":{"id":"baf70018046d0f9b","repo":"apache/cassandra","slug":"setting-bucket-size-to-zero-clears-config-cannot","errorCode":null,"errorMessage":"Setting bucket size to zero clears config; cannot set other fields.","messagePattern":"Setting bucket size to zero clears config; cannot set other fields\\.","errorType":"validation","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java","lineNumber":1193,"sourceCode":"                    case \"bucket_size\":\n                        newBucketSize = checkNonNegative(values[i], name, 0);\n                        break;\n                    case \"bucket_sub_size\":\n                        newBucketSubSize = checkNonNegative(values[i], name, 0);\n                        break;\n                    case \"bucket_seen\":\n                        newBucketSeen = checkNonNegative(values[i], name, 0);\n                        break;\n                    case \"trace_events\":\n                        newTrace = tryParseCoordinationKinds(values[i]);\n                        break;\n                }\n            }\n\n            if (newBucketSize == 0)\n            {\n                if (newBucketMode != null || newBucketSeen > 0 || newBucketSubSize > 0 || !Float.isNaN(newChance) || (newTrace != null && !newTrace.isEmpty()))\n                    throw new InvalidRequestException(\"Setting bucket size to zero clears config; cannot set other fields.\");\n                tracing().stopTracing(txnId);\n            }\n            else\n            {\n                if (newBucketSubSize == 0)\n                    throw new InvalidRequestException(\"Cannot set bucket_sub_size to zero.\");\n                tracing().set(txnId, newTrace, newBucketMode, newBucketSize, newBucketSubSize, newBucketSeen, newChance, unsetManagedByOwner);\n            }\n        }\n\n        @Override\n        public void truncate()\n        {\n            tracing().eraseAllBuckets();\n        }\n    }\n\n    public static final class TxnTracesTable extends AbstractMutableLazyVirtualTable","sourceCodeStart":1175,"sourceCodeEnd":1211,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java#L1175-L1211","documentation":"Setting bucket_size to 0 in the accord_debug tracing table means 'stop tracing and clear the bucket configuration'. Combining it with any other field assignment is ambiguous and rejected with InvalidRequestException before stopping tracing.","triggerScenarios":"Executing an UPDATE that sets bucket_size = 0 together with any of bucket_mode, bucket_seen, bucket_sub_size, chance, or a non-empty trace value in the same statement.","commonSituations":"Batching multiple tuning fields into one UPDATE while also disabling tracing; scripted reconfiguration that always writes all columns including zeros.","solutions":["Issue bucket_size = 0 alone in its own UPDATE to stop tracing and clear config.","Apply other field updates in a separate, subsequent (or prior) statement.","Adjust automation to skip writing the other fields when bucket_size is 0."],"exampleFix":"// before\nsession.execute(\"UPDATE system_views.accord_debug_tracing SET bucket_size = 0, chance = 0.5 WHERE txn_id = '...'\");\n// after\nsession.execute(\"UPDATE system_views.accord_debug_tracing SET bucket_size = 0 WHERE txn_id = '...'\");\nsession.execute(\"UPDATE system_views.accord_debug_tracing SET chance = 0.5 WHERE txn_id = '...'\");","handlingStrategy":"validation","validationCode":"if (setsBucketSizeZero(update) && assignmentColumnCount(update) > 1) throw new IllegalArgumentException(\"bucket_size=0 must be the only assignment in the statement\");","typeGuard":null,"tryCatchPattern":"try { session.execute(update); } catch (com.datastax.driver.core.exceptions.InvalidQueryException e) { if (e.getMessage().contains(\"bucket size to zero clears config\")) { /* split into separate statements */ } else throw e; }","preventionTips":["Always issue bucket_size=0 as a standalone UPDATE","Split multi-field tuning into separate statements","Have automation skip other columns when bucket_size is 0"],"tags":["virtual-table","accord","conflicting-options","cassandra"],"backgroundTag":"conflicting-config-options","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"}