Skip to content

Conversation

@k-rus
Copy link
Member

@k-rus k-rus commented Mar 14, 2025

What is the issue

Fixes https://github.com/riptano/cndb/issues/13299

Creating an index with too long index names leads to file errors or incorrect results.

What does this PR fix and why was it fixed

This PR prevents creating new indexes, i.e., not internal, with provided index names longer than 182 characters. This constant is based on the most restrictive requirement from different index types. It comes from SAI by subtracting the longest file name addition from the file name limit of 255 characters.

@github-actions
Copy link

github-actions bot commented Mar 14, 2025

Checklist before you submit for review

  • Make sure there is a PR in the CNDB project updating the Converged Cassandra version
  • Use NoSpamLogger for log lines that may appear frequently in the logs
  • Verify test results on Butler
  • Test coverage for new/modified code is > 80%
  • Proper code formatting
  • Proper title for each commit staring with the project-issue number, like CNDB-1234
  • Each commit has a meaningful description
  • Each commit is not very long and contains related changes
  • Renames, moves and reformatting are in distinct commits

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC the file names are the result of the concatenation of the keyspace and tablename and the indexname, why don't we consider tableName.length() + keyspaceName.length() here ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, file names for indexes do not use keyspace and table names when an index name is explicitly given. See the discussion in the issue.

@k-rus k-rus requested review from a team and eolivelli March 14, 2025 10:32
@k-rus k-rus force-pushed the rf-cndb-13299-long-index-name branch from 09d48cd to 136c691 Compare March 18, 2025 17:56
@sonarqubecloud
Copy link

@cassci-bot
Copy link

❌ Build ds-cassandra-pr-gate/PR-1633 rejected by Butler


1 new test failure(s) in 4 builds
See build details here


Found 1 new test failures

Test Explanation Branch history Upstream history
o.a.c.u.b.BinLogTest.testTruncationReleasesLogS... regression 🔴🔵🔵🔴 🔵🔵🔵🔵🔵🔵🔵

Found 32 known test failures

@k-rus k-rus changed the title CNDB-13299 prevent too long index name CNDB-13299 prevent too long index names Mar 19, 2025
@k-rus k-rus merged commit f27dc68 into main Mar 19, 2025
472 of 478 checks passed
@k-rus k-rus deleted the rf-cndb-13299-long-index-name branch March 19, 2025 09:12
djatnieks pushed a commit that referenced this pull request Apr 14, 2025
Creating an index with too long index names leads to file errors or
incorrect results.

This PR prevents creating new indexes, i.e., not internal, with provided
index names longer than 182 characters. This constant is based on the
most restrictive requirement from different index types. It comes from
SAI by subtracting the longest file name addition from the file name
limit of 255 characters.
djatnieks pushed a commit that referenced this pull request May 18, 2025
Creating an index with too long index names leads to file errors or
incorrect results.

This PR prevents creating new indexes, i.e., not internal, with provided
index names longer than 182 characters. This constant is based on the
most restrictive requirement from different index types. It comes from
SAI by subtracting the longest file name addition from the file name
limit of 255 characters.
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.

4 participants