Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CNDB-12451 validate keyspace+table names length #1553

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

k-rus
Copy link

@k-rus k-rus commented Feb 6, 2025

What is the issue

The length of table names were not validated for acceptable size for a
file name, since the creation was invoking a validation function with
similar name but without length validation.
Furthermore, a file name is constructed by concatenating keyspace and
table names through a separator. This was never validated if the
combined name will be too large for a file name.

What does this PR fix and why was it fixed

Fixes https://github.com/riptano/cndb/issues/12683, fixes https://github.com/riptano/cndb/issues/12451.

This commit changes validations during table creations:

  • to validate table name to include the length validation;
  • to add validation of keyspace and table names combined.

CNDB's PR with this artifact: https://github.com/riptano/cndb/pull/12779

Copy link

github-actions bot commented Feb 6, 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

@k-rus k-rus requested review from a team February 7, 2025 09:02
k-rus added 3 commits February 7, 2025 12:37
Fixes CNDB-12451 and CNDB-12683.

The length of table names wasn't validated for acceptable size for a
file name, since the creation was invoking a validation function with
similar name but without length validation.
Furthermore, a file name is constructed by concatenating keyspace and
table names through a separator. This was never validated if the
combined name will be too large for a file name.

This commit changes validations during table creations:
- to validate table name to include the length validation;
- to add validation of keyspace and table names combined;
- to remove validation of keyspace name, which is already part of
  keyspace creation.
Use the validation function, which also checks the length of the name.
@k-rus k-rus force-pushed the rf-cndb-12683-long-table-file-name branch from a867057 to 17b63f2 Compare February 7, 2025 11:37
@cassci-bot
Copy link

✔️ Build ds-cassandra-pr-gate/PR-1553 approved by Butler


Approved by Butler
See build details here

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.

2 participants