Skip to content

[Backport 2025.2] cql, schema: Extend keyspace, table, views, indexes name length limit from 48 to 192 bytes#24603

Merged
scylladb-promoter merged 2 commits intoscylladb:branch-2025.2from
scylladbbot:backport/24500/to-2025.2
Jun 23, 2025
Merged

[Backport 2025.2] cql, schema: Extend keyspace, table, views, indexes name length limit from 48 to 192 bytes#24603
scylladb-promoter merged 2 commits intoscylladb:branch-2025.2from
scylladbbot:backport/24500/to-2025.2

Conversation

@scylladbbot
Copy link
Copy Markdown

cql, schema: Extend name length limit from 48 to 192 bytes

This commit increases the maximum length of names for keyspaces, tables, materialized views, and indexes from 48 to 192 bytes.
The previous 48-bytes limit was inherited from Cassandra 3 for compatibility. However, this validation was removed in Cassandra 4 and 5 (see CASSANDRA-20389)
and some usage scenarios (such as some feature store workflows generating long table names) now depend on this relaxed constraint.
This change brings ScyllaDB's behavior in line with modern Cassandra versions and better supports these use cases.

The new limit of 192 bytes is derived from underlying filesystem limitations to prevent runtime errors when creating directories for table data.
When a new table is created, ScyllaDB generates a directory for its SSTables. The directory name is constructed from the table name, a dash, and a 32-character UUID.
For a CDC-enabled table, an associated log table is also created, which has the suffix `_scylla_cdc_log` appended to its name.
The directory name for this log table becomes the longest possible representation.
Additionally we reserve 15 bytes for future use, allowing for potential future extensions without breaking existing schemas.
To guarantee that directory creation never fails due to exceeding filesystem name limits, the maximum name length is calculated as follows:
  255 bytes (common filesystem limit for a path component)
-  32 bytes (for the 32-character UUID string)
-   1 byte  (for the '-' separator)
-  15 bytes (for the '_scylla_cdc_log' suffix)
-  15 bytes (reserved for future use)
----------
= 192 bytes (Maximum allowed name length)
This calculation is similar in principle to the one proposed for Cassandra to fix related directory creation failures (see apache/cassandra/pull/4038).

This patch also updates/adds all associated tests to validate the new 192-byte limit.
The documentation has been updated accordingly.

Fixes #4480

Backport 2025.2: The significantly shorter maximum table name length in Scylla compared to Cassandra is becoming a more common issue for users in the latest release.

  • (cherry picked from commit a41c12c)

  • (cherry picked from commit 4577c66)

Parent PR: #24500

@scylladbbot scylladbbot requested review from nyh and tgrabiec as code owners June 22, 2025 17:37
knowack1 added 2 commits June 22, 2025 17:38
This function was declared but had no implementation or callers. It is being removed as minor code cleanup.

(cherry picked from commit a41c12c)
This commit increases the maximum length of names for keyspaces, tables, materialized views, and indexes from 48 to 192 bytes.
The previous 48-bytes limit was inherited from Cassandra 3 for compatibility. However, this validation was removed in Cassandra 4 and 5 (see CASSANDRA-20389)
and some usage scenarios (such as some feature store workflows generating long table names) now depend on this relaxed constraint.
This change brings ScyllaDB's behavior in line with modern Cassandra versions and better supports these use cases.

The new limit of 192 bytes is derived from underlying filesystem limitations to prevent runtime errors when creating directories for table data.
When a new table is created, ScyllaDB generates a directory for its SSTables. The directory name is constructed from the table name, a dash, and a 32-character UUID.
For a CDC-enabled table, an associated log table is also created, which has the suffix `_scylla_cdc_log` appended to its name.
The directory name for this log table becomes the longest possible representation.
Additionally we reserve 15 bytes for future use, allowing for potential future extensions without breaking existing schemas.
To guarantee that directory creation never fails due to exceeding filesystem name limits, the maximum name length is calculated as follows:
  255 bytes (common filesystem limit for a path component)
-  32 bytes (for the 32-character UUID string)
-   1 byte  (for the '-' separator)
-  15 bytes (for the '_scylla_cdc_log' suffix)
-  15 bytes (reserved for future use)
----------
= 192 bytes (Maximum allowed name length)
This calculation is similar in principle to the one proposed for Cassandra to fix related directory creation failures (see apache/cassandra/pull/4038).

This patch also updates/adds all associated tests to validate the new 192-byte limit.
The documentation has been updated accordingly.

(cherry picked from commit 4577c66)
@scylladbbot scylladbbot force-pushed the backport/24500/to-2025.2 branch from 7b9aa3f to 76bd23c Compare June 22, 2025 17:38
@scylladb-promoter
Copy link
Copy Markdown
Contributor

Docs Preview 📖

Docs Preview for this pull request is available here

Changed Files:

Note: This preview will be available for 30 days and will be automatically deleted after that period. You can manually trigger a new build by committing changes.

@scylladb-promoter
Copy link
Copy Markdown
Contributor

🟢 CI State: SUCCESS

✅ - Framework test
✅ - Build
✅ - Unit Tests Custom
The following new/updated tests ran 100 times for each mode:
🔹 boost/cql_query_test
✅ - dtest with gossip topology changes
✅ - dtest with consistent topology changes
✅ - dtest with tablets
✅ - Unit Tests

Build Details:

  • Duration: 7 hr 28 min
  • Builder: spider5.cloudius-systems.com

@swasik
Copy link
Copy Markdown
Contributor

swasik commented Jun 23, 2025

Note: it is required by external framework that allows implementing feature stores using various DBs: https://github.com/featureform/featureform - we want to have working integration ASAP and that is why the backport is needed.

@nyh
Copy link
Copy Markdown
Contributor

nyh commented Jun 23, 2025

Merged to next-2025.2. 34bdbad

@scylladb-promoter scylladb-promoter merged commit 34bdbad into scylladb:branch-2025.2 Jun 23, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants