{"record":{"id":"0adc637efc404183","repo":"apache/cassandra","slug":"cannot-set-bucket-sub-size-to-zero","errorCode":null,"errorMessage":"Cannot set bucket_sub_size to zero.","messagePattern":"Cannot set bucket_sub_size to zero\\.","errorType":"validation","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java","lineNumber":1199,"sourceCode":"                    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\n    {\n        private TxnTracesTable()\n        {\n            super(parse(VIRTUAL_ACCORD_DEBUG, TXN_TRACES,\n                        \"Accord Transaction Traces\",\n                        \"CREATE TABLE %s (\\n\" +","sourceCodeStart":1181,"sourceCodeEnd":1217,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java#L1181-L1217","documentation":"When bucket_size is non-zero, bucket_sub_size must also be non-zero; assigning 0 to bucket_sub_size is rejected with InvalidRequestException because a positive bucket size with zero sub-size is an invalid bucketing configuration.","triggerScenarios":"Executing 'UPDATE system_views.accord_debug_tracing SET bucket_sub_size = 0 WHERE txn_id = ...' while tracing/bucketing remains enabled (bucket_size != 0).","commonSituations":"Trying to disable sub-bucketing by zeroing it instead of stopping tracing entirely; scripted tuning writing default zero values for unset parameters.","solutions":["Set bucket_sub_size to a positive value, or omit it from the UPDATE.","To disable tracing entirely, set bucket_size = 0 (alone) rather than bucket_sub_size = 0.","Validate that any scripted write includes only positive values for bucket_sub_size."],"exampleFix":"// before\nsession.execute(\"UPDATE system_views.accord_debug_tracing SET bucket_sub_size = 0 WHERE txn_id = '...'\");\n// after\n// disable tracing via bucket_size = 0, or use a positive sub-size\nsession.execute(\"UPDATE system_views.accord_debug_tracing SET bucket_sub_size = 10 WHERE txn_id = '...'\");","handlingStrategy":"validation","validationCode":"if (assignmentValue(\"bucket_sub_size\", update) == 0) throw new IllegalArgumentException(\"bucket_sub_size must be positive; use bucket_size=0 to disable tracing\");","typeGuard":null,"tryCatchPattern":"try { session.execute(update); } catch (com.datastax.driver.core.exceptions.InvalidQueryException e) { if (e.getMessage().contains(\"bucket_sub_size to zero\")) { /* use positive value or bucket_size=0 */ } else throw e; }","preventionTips":["Use positive values for bucket_sub_size","Disable tracing via bucket_size=0, not by zeroing sub-size","Validate numeric fields > 0 in scripts before writing"],"tags":["virtual-table","accord","value-out-of-range","cassandra"],"backgroundTag":"invalid-config-value","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"}