Skip to content

Commit

Permalink
Fix interaction between overlay and auxiliary purge/wipe
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisspyB committed Aug 12, 2024
1 parent cf021ef commit f70eb76
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
13 changes: 10 additions & 3 deletions src/fdb5/toc/TocPurgeVisitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,16 @@ bool TocPurgeVisitor::visitDatabase(const Catalogue& catalogue, const Store& sto
indexUsage_[path] += 0;
}

for (const auto& path : data) {
allDataFiles_.insert(path.path());
dataUsage_[path.path()] += 0;
for (const auto& uri : data) {
if (!store.uriBelongs(uri)) {
Log::error() << "Catalogue is pointing to data files that do not belong to the store." << std::endl;
Log::error() << "Configured Store URI: " << store.uri().asString() << std::endl;
Log::error() << "Pointed Store unit URI: " << uri.asString() << std::endl;
Log::error() << "This may occur when purging an overlayed FDB, which is not supported." << std::endl;
NOTIMP;
}
allDataFiles_.insert(uri.path());
dataUsage_[uri.path()] += 0;
}

return true;
Expand Down
7 changes: 5 additions & 2 deletions src/fdb5/toc/TocWipeVisitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ bool TocWipeVisitor::visitIndex(const Index& index) {

std::vector<eckit::URI> indexDataPaths(index.dataURIs());
for (const eckit::URI& uri : store_.asCollocatedDataURIs(indexDataPaths)) {
auto auxPaths = getAuxiliaryPaths(uri);
if (include) {
if (!store_.uriBelongs(uri)) {
Log::error() << "Index to be deleted has pointers to fields that don't belong to the configured store." << std::endl;
Expand All @@ -174,10 +173,14 @@ bool TocWipeVisitor::visitIndex(const Index& index) {
NOTIMP;
}
dataPaths_.insert(eckit::PathName(uri.path()));
auto auxPaths = getAuxiliaryPaths(uri);
auxiliaryDataPaths_.insert(auxPaths.begin(), auxPaths.end());
} else {
safePaths_.insert(eckit::PathName(uri.path()));
safePaths_.insert(auxPaths.begin(), auxPaths.end());
if (store_.uriBelongs(uri)) {
auto auxPaths = getAuxiliaryPaths(uri);
safePaths_.insert(auxPaths.begin(), auxPaths.end());
}
}
}

Expand Down

0 comments on commit f70eb76

Please sign in to comment.