Skip to content

Conversation

@jasonstack
Copy link

@jasonstack jasonstack commented Dec 4, 2025

What is the issue

CNDB-16135: Descriptor uses different instances of Path directory for the same table as constructor parameter

What does this PR fix and why was it fixed

Use the table directory from Directories in Descriptor as constructor parameter . Descriptor#directory is still different instance in C* due to directory#toCanonical() which always creates new instance in local file system

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

Checklist before you submit for review

  • This PR adheres to the Definition of Done
  • 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

Copy link

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

Great catch

@jasonstack jasonstack requested a review from pcmanus December 4, 2025 09:37
{
assert version != null && directory != null && ksname != null && cfname != null && formatType.info.getLatestVersion().getClass().equals(version.getClass());
this.version = version;
// toCanonical() returns a new instance most of the time in C*. Plugable FS may behave differently to reuse instance if nothing to canonicalize.
Copy link

Choose a reason for hiding this comment

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

Nit: I'm unsure how useful that comment is, here, for someone that doesn't have the context of the issue we're solving here. I wonder if it's not more distracting. And File#toCanonical is just:

Path canonical = PathUtils.toCanonicalPath(toPath());
return canonical == path ? this : new File(canonical);

so one doesn't have to go far to see that there is circumstance where no new instances may be created, if one is explicitly wondering.

Copy link
Author

Choose a reason for hiding this comment

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

good point, removed

* @param name the name of the sstable to parse
* @return a pair of the descriptor and component corresponding to the provided {@code file}.
*
* @throws IllegalArgumentException if the provided {@code file} does point to a valid sstable filename. This could
Copy link

Choose a reason for hiding this comment

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

Nit: typo in the comment: if the provided {@code file} does *not* point to a valid sstable. The typo comes from the comment from the previous method, so let's fix both.

Copy link
Author

Choose a reason for hiding this comment

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

fixed this and other methods

@jasonstack jasonstack force-pushed the cndb-16135-main branch 2 times, most recently from b328d75 to 1485b9c Compare December 8, 2025 03:12
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 9, 2025

@cassci-bot
Copy link

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


2 regressions found
See build details here


Found 2 new test failures

Test Explanation Runs Upstream
o.a.c.index.sai.cql.VectorCompaction100dTest.testPQRefine[eb true] NEW 🔴 0 / 19
o.a.c.index.sai.cql.VectorSiftSmallTest.testMultiSegmentBuild[dc false] REGRESSION 🔴 0 / 19

Found 3 known test failures

@jasonstack jasonstack merged commit 79f25c7 into main Dec 9, 2025
490 of 497 checks passed
@jasonstack jasonstack deleted the cndb-16135-main branch December 9, 2025 08:24
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