CNDB-16697: CNDB-16135: reuse table directory from Directories into Descriptor#2277
CNDB-16697: CNDB-16135: reuse table directory from Directories into Descriptor#2277
Conversation
…2150) CNDB-16135: Descriptor uses different instances of `Path directory` for the same table as constructor parameter 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
Checklist before you submit for review
|
|
❌ Build ds-cassandra-pr-gate/PR-2277 rejected by Butler3 regressions found Found 3 new test failures
Found 1 known test failures |
djatnieks
left a comment
There was a problem hiding this comment.
The changes you have did match the ones I originally recommended.
However, I made a mistake in thinking the existing methods in 5.0 could be re-used. We do need the additional override method and we do need to avoid using new File.
The original fix here was specifically for CNDB code where we use a RemoteFilesystem and RemotePath, and (in CNDB) calls through PathUtils.toCanonicalPath() is able to return the same instance rather than always creating new instances.
|
|
||
| /** | ||
| * Parse a sstable filename, extracting both the {@code Descriptor} and {@code Component} part. | ||
| * The keyspace/table name will be extracted from the directory path. |
There was a problem hiding this comment.
nit: suggest to keep this line, as it was not present/affected I think on main branch
* The keyspace/table name will be extracted from the directory path.
| File dir = dataPaths[dirNumber]; | ||
| File file = dir.resolve(filename); | ||
| return Descriptor.fromFile(file); | ||
| return Descriptor.fromFileWithComponent(new File(dir, filename), true).left; |
There was a problem hiding this comment.
| return Descriptor.fromFileWithComponent(new File(dir, filename), true).left; | |
| return Descriptor.fromFileWithComponent(dir, filename, true).left; |
Actually, I think using new File here defeats the purpose of the original ticket, so I made a few additional changes.
There was a problem hiding this comment.
@zgorzalyj I think this should be changed to
return Descriptor.fromFileWithComponent(dir, filename, true).left;
to use the change you made in commit 97ab09d
|
@jasonstack Hello, can you help review these changes please? I think the original guidance I gave to @zgorzalyj was not correct and I have attempted to correct that, but your input would be appreciated! |
|
@djatnieks I will take a look this week |
Co-authored-by: Daniel Jatnieks <dan.jatnieks@ibm.com>
|
@jasonstack Did you have a chance to review? |
There was a problem hiding this comment.
LGTM.
CNDB side has unit tests with remote file system to verify the changes in CC. When CC5 is ready to integrate with CNDB, we will be able to validate the changes here
djatnieks
left a comment
There was a problem hiding this comment.
I think one more change is needed
| File dir = dataPaths[dirNumber]; | ||
| File file = dir.resolve(filename); | ||
| return Descriptor.fromFile(file); | ||
| return Descriptor.fromFileWithComponent(new File(dir, filename), true).left; |
There was a problem hiding this comment.
@zgorzalyj I think this should be changed to
return Descriptor.fromFileWithComponent(dir, filename, true).left;
to use the change you made in commit 97ab09d


https://github.com/riptano/cndb/issues/16697
Port into main-5.0
commit 79f25c7
Author: Zhao Yang zhaoyangsingapore@gmail.com
Date: Tue Dec 9 16:24:25 2025 +0800