apache/cassandra · error · InvalidRequestException

Cannot set transactional migration on new tables

Error message

Cannot set transactional migration on new tables (%s.%s), %s

What it means

CREATE TABLE included a transactional_migration_from setting, but migration of an existing table's transactional mode only makes sense on tables that already exist. New tables cannot start in a migrating state, so Cassandra rejects the DDL.

Solutions

  1. Remove the transactional_migration_from clause from the CREATE TABLE statement
  2. Create the table normally, then use ALTER TABLE ... to perform the transactional mode migration

Example fix

// before
CREATE TABLE ks.t (k int PRIMARY KEY) WITH transactional_migration_from = 'disabled';
// after
CREATE TABLE ks.t (k int PRIMARY KEY);
ALTER TABLE ks.t WITH transactional_migration_from = 'disabled';
Defensive patterns

Strategy: validation

Validate before calling

if (ddl.contains("transactional_migration_from") && ddl.trim().toUpperCase().startsWith("CREATE TABLE")) throw new IllegalArgumentException("transactional_migration_from is only valid on ALTER TABLE");

Try / catch

try { session.execute(ddl); } catch (InvalidRequestException e) { if (e.getMessage().contains("transactional migration on new tables")) { /* strip the clause and retry */ } else throw e; }

Prevention

When it happens

Trigger: `CREATE TABLE ... WITH transactional_migration_from = 'disabled'` (any isMigrating() value such as migrating_to_full) on a brand-new table.

Common situations: Copying ALTER TABLE transactional-migration syntax from an Accord migration runbook into a CREATE TABLE statement; scripted DDL generation that emits migration clauses for both CREATE and ALTER.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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

Appendix: source

Thrown at src/java/org/apache/cassandra/cql3/statements/schema/CreateTableStatement.java:196

        if (keyspace.replicationStrategy.hasTransientReplicas()
            && table.params.readRepair != ReadRepairStrategy.NONE)
        {
            throw ire("read_repair must be set to 'NONE' for transiently replicated keyspaces");
        }

        if (!table.params.compression.isEnabled() && !SchemaConstants.isSystemKeyspace(table.keyspace))
            Guardrails.uncompressedTablesEnabled.ensureEnabled(state);

        if (table.params.transactionalMode.accordIsEnabled && SchemaConstants.isSystemKeyspace(keyspaceName))
            throw ire("Cannot enable accord on system tables (%s.%s)", keyspaceName, tableName);

        if (table.params.transactionalMode.accordIsEnabled && !DatabaseDescriptor.getAccordTransactionsEnabled())
            throw ire(format("Cannot create table %s.%s with transactional mode %s with accord.enabled set to false",
                             keyspaceName, tableName, table.params.transactionalMode));

        if (table.params.transactionalMigrationFrom.isMigrating())
            throw ire("Cannot set transactional migration on new tables (%s.%s), %s", keyspaceName, tableName, table.params.transactionalMigrationFrom);

        return schema.withAddedOrUpdated(keyspace.withSwapped(keyspace.tables.with(table)));
    }

    @Override
    public void validate(ClientState state)
    {
        super.validate(state);

        // If a memtable configuration is specified, validate it against config
        if (attrs.hasOption(TableParams.Option.MEMTABLE))
            MemtableParams.get(attrs.getString(TableParams.Option.MEMTABLE.toString()));

        // Guardrail on table properties
        Guardrails.tableProperties.guard(attrs.updatedProperties(), attrs::removeProperty, state);

        // Guardrail on columns per table
        Guardrails.columnsPerTable.guard(rawColumns.size(), tableName, false, state);

View on GitHub (pinned to 88fd0f6a0e)