Skip to content

CNDB-14239: expose index components validation method with no side-effect (#1794) #1882

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

Merged
merged 1 commit into from
Jul 17, 2025

Conversation

driftx
Copy link

@driftx driftx commented Jul 16, 2025

The existing IndexComponents#validateComponents method validates some group of index components files (ensure we have all the files we should have, and ensure they looks valid), but it also has some side-effect backed in. It potentially deletes invalid components it found, and invalidate the whole group if validation fails, which rewrite the sstable TOC and whatnot.

For CNDB, it would be useful to be able to validate components on reload without necessarily triggering the side effects, and the plan is to rely on such no-side-effect variant in the patch for
https://github.com/riptano/cndb/issues/14239. But I'd argue having this variant make sense in general and could easily have other uses later, and the changes are trivially backward compatible (they only introduce 2 new methods.

…fect (#1794)

The existing `IndexComponents#validateComponents` method validates some
group of index components files (ensure we have all the files we should
have, and ensure they looks valid), but it also has some side-effect
backed in. It potentially deletes invalid components it found, and
invalidate the whole group if validation fails, which rewrite the
sstable TOC and whatnot.

For CNDB, it would be useful to be able to validate components on reload
without necessarily triggering the side effects, and the plan is to rely
on such no-side-effect variant in the patch for
riptano/cndb#14239. But I'd argue having this
variant make sense in general and could easily have other uses later,
and the changes are trivially backward compatible (they only introduce 2
new methods.
Copy link

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
  • All new files should contain the DataStax copyright header instead of the Apache License one

@driftx
Copy link
Author

driftx commented Jul 16, 2025

5.0's validateComponents method has an extra boolean rethrow parameter, this patch preserves and handles it by throwing an UncheckedIOException when validation fails and rethrow is true.

The static deleteComponentFile method's functionality was moved into the new instance delete() method that was added to the IndexComponent.ForWrite interface by the original patch.

Copy link

@cassci-bot
Copy link

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


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


Found 38 new test failures

Showing only first 15 new test failures

Test Explanation Branch history Upstream history
...lidation.operations.AlterTest-compression_jdk11 regression 🔴
...nQueryShouldNotTimeoutWhenItExceedesReadTimeout regression 🔴
...nglePageReadIsFastButAggregationExceedesTimeout regression 🔴
...adCommitLogAndSSTablesWithDroppedColumnTestCC50 regression 🔴
...oadCommitLogAndSSTablesWithDroppedColumnTestDSE regression 🔴
...thRestartTest.testReadingValuesOfDroppedColumns regression 🔴
o.a.c.d.t.s.f.FeaturesVersionSupportDBTest.testANN regression 🔴
o.a.c.d.t.s.f.FeaturesVersionSupportDCTest.testANN regression 🔴
o.a.c.d.t.s.f.FeaturesVersionSupportEBTest.testANN regression 🔴
...c.FeaturesVersionSupportTest.testANNSupport[eb] regression 🔴
....FeaturesVersionSupportTest.testGeoDistance[aa] regression 🔴
....FeaturesVersionSupportTest.testGeoDistance[ba] regression 🔴
....s.f.SnapshotTest.shouldTakeAndRestoreSnapshots regression 🔴
...cySSTableTest.testVerifyOldDroppedTupleSSTables regression 🔴
...m.TrieMemtableMetricsTest.testContentionMetrics regression 🔴

No known test failures found

@driftx driftx merged commit f9f7dc5 into main-5.0 Jul 17, 2025
567 of 590 checks passed
@driftx driftx deleted the CNDB-14827 branch July 17, 2025 14:21
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