apache/cassandra · error · InvalidRequestException

Cannot set bucket_sub_size to zero.

Error message

Cannot set bucket_sub_size to zero.

What it means

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.

Source

Thrown at src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java:1199

                    case "bucket_seen":
                        newBucketSeen = checkNonNegative(values[i], name, 0);
                        break;
                    case "trace_events":
                        newTrace = tryParseCoordinationKinds(values[i]);
                        break;
                }
            }

            if (newBucketSize == 0)
            {
                if (newBucketMode != null || newBucketSeen > 0 || newBucketSubSize > 0 || !Float.isNaN(newChance) || (newTrace != null && !newTrace.isEmpty()))
                    throw new InvalidRequestException("Setting bucket size to zero clears config; cannot set other fields.");
                tracing().stopTracing(txnId);
            }
            else
            {
                if (newBucketSubSize == 0)
                    throw new InvalidRequestException("Cannot set bucket_sub_size to zero.");
                tracing().set(txnId, newTrace, newBucketMode, newBucketSize, newBucketSubSize, newBucketSeen, newChance, unsetManagedByOwner);
            }
        }

        @Override
        public void truncate()
        {
            tracing().eraseAllBuckets();
        }
    }

    public static final class TxnTracesTable extends AbstractMutableLazyVirtualTable
    {
        private TxnTracesTable()
        {
            super(parse(VIRTUAL_ACCORD_DEBUG, TXN_TRACES,
                        "Accord Transaction Traces",
                        "CREATE TABLE %s (\n" +

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Set bucket_sub_size to a positive value, or omit it from the UPDATE.
  2. To disable tracing entirely, set bucket_size = 0 (alone) rather than bucket_sub_size = 0.
  3. Validate that any scripted write includes only positive values for bucket_sub_size.

Example fix

// before
session.execute("UPDATE system_views.accord_debug_tracing SET bucket_sub_size = 0 WHERE txn_id = '...'");
// after
// disable tracing via bucket_size = 0, or use a positive sub-size
session.execute("UPDATE system_views.accord_debug_tracing SET bucket_sub_size = 10 WHERE txn_id = '...'");
Defensive patterns

Strategy: validation

Validate before calling

if (assignmentValue("bucket_sub_size", update) == 0) throw new IllegalArgumentException("bucket_sub_size must be positive; use bucket_size=0 to disable tracing");

Try / catch

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; }

Prevention

When it happens

Trigger: Executing 'UPDATE system_views.accord_debug_tracing SET bucket_sub_size = 0 WHERE txn_id = ...' while tracing/bucketing remains enabled (bucket_size != 0).

Common situations: Trying to disable sub-bucketing by zeroing it instead of stopping tracing entirely; scripted tuning writing default zero values for unset parameters.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/0adc637efc404183. Report an issue: GitHub.