Skip to content

Commit

Permalink
node: let sstable_regexp match with sstable with uuid generation
Browse files Browse the repository at this point in the history
also update the comment to reflect the latest changes.

this should enable the dtest to test with uuid-based sstable
identifiers enabled.

Signed-off-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov authored and fruch committed Aug 8, 2023
1 parent 4f619b7 commit 38d32ab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ccmlib/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ def __decode(self, value):

NodetoolError = ToolError

# Groups: 1 = cf, 2 = tmp or none, 3 = suffix (Compacted or Data.db)
_sstable_regexp = re.compile(r'((?P<keyspace>[^\s-]+)-(?P<cf>[^\s-]+)-)?(?P<tmp>tmp(link)?-)?(?P<version>[^\s-]+)-(?P<number>\d+)-(?P<big>big-)?(?P<suffix>[a-zA-Z]+)\.[a-zA-Z0-9]+$')
# Groups: 0 = ks, 1 = cf, 2 = tmp or none, 3 = version, 4 = identifier (generation), 4 = "big-" or none, 5 = suffix (Compacted or Data.db)
_sstable_regexp = re.compile(r'((?P<keyspace>[^\s-]+)-(?P<cf>[^\s-]+)-)?(?P<tmp>tmp(link)?-)?(?P<version>[^\s-]+)-(?P<identifier>[^-]+)-(?P<big>big-)?(?P<suffix>[a-zA-Z]+)\.[a-zA-Z0-9]+$')


class Node(object):
Expand Down Expand Up @@ -1871,10 +1871,10 @@ def __gather_sstables(self, datafiles=None, keyspace=None, columnfamilies=None):
raise NodeError("File doesn't seem to be a valid sstable filename: " + datafile)

sstable = sstable.groupdict()
if not sstable['tmp'] and sstable['number'] not in sstables:
if not sstable['tmp'] and sstable['identifier'] not in sstables:
if not os.path.exists(datafile):
raise IOError("File doesn't exist: " + datafile)
sstables.add(sstable['number'])
sstables.add(sstable['identifier'])
files.append(datafile)

return files
Expand Down

0 comments on commit 38d32ab

Please sign in to comment.