mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-31 03:56:42 +00:00
Commitlog: Handle full paths in descriptor file name parse.
This commit is contained in:
@@ -90,7 +90,7 @@ db::commitlog::descriptor::descriptor(sstring filename)
|
||||
: descriptor([filename]() {
|
||||
std::smatch m;
|
||||
// match both legacy and new version of commitlogs Ex: CommitLog-12345.log and CommitLog-4-12345.log.
|
||||
std::regex rx(FILENAME_PREFIX + "((\\d+)(" + SEPARATOR + "\\d+)?)" + FILENAME_EXTENSION);
|
||||
std::regex rx("(?:.*/)?" + FILENAME_PREFIX + "((\\d+)(" + SEPARATOR + "\\d+)?)" + FILENAME_EXTENSION);
|
||||
std::string sfilename = filename;
|
||||
if (!std::regex_match(sfilename, m, rx)) {
|
||||
throw std::runtime_error("Cannot parse the version of the file: " + filename);
|
||||
|
||||
Reference in New Issue
Block a user