Skip to content

Commit 4840a2c

Browse files
PS-11002 fix: changing storage prefix fails
https://perconadev.atlassian.net/browse/PS-11002 Having just single 'metadata.json' in the storage is no longer considered an integrity violation for the 'storage' initialization logic. In this case we simply validate this storage metadata file and return early (basically, consider this layout an empty storage).
1 parent e7b7839 commit 4840a2c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/binsrv/storage.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ storage::storage(const storage_config &config,
8383
load_metadata();
8484
validate_metadata(replication_mode);
8585

86+
// if after metadata erasure 'storage_objects' is empty, then this mean
87+
// that it has only metadata in it that passes validation and we can
88+
// consider it as an initialized empty storage, so just return
89+
if (storage_objects.empty()) {
90+
return;
91+
}
92+
8693
const auto binlog_index_it{storage_objects.find(default_binlog_index_name)};
8794
if (binlog_index_it == std::cend(storage_objects)) {
8895
util::exception_location().raise<std::logic_error>(

0 commit comments

Comments
 (0)