-
Notifications
You must be signed in to change notification settings - Fork 21
CNDB-16135: reuse table directory from Directories into Descriptor #2150
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
Conversation
Checklist before you submit for review
|
eolivelli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch
| { | ||
| 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
b328d75 to
1485b9c
Compare
1485b9c to
b2e1765
Compare
|
❌ Build ds-cassandra-pr-gate/PR-2150 rejected by Butler2 regressions found Found 2 new test failures
Found 3 known test failures |



What is the issue
CNDB-16135: Descriptor uses different instances of
Path directoryfor the same table as constructor parameterWhat does this PR fix and why was it fixed
Use the table directory from
DirectoriesinDescriptoras constructor parameter .Descriptor#directoryis still different instance in C* due todirectory#toCanonical()which always creates new instance in local file system