mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 16:26:18 +02:00
Skip deletion of lower paths for overlay store GC.
This commit is contained in:
parent
98edbb9686
commit
a48acfd684
2 changed files with 15 additions and 1 deletions
|
@ -182,7 +182,7 @@ void LocalOverlayStore::addToStore(const ValidPathInfo & info, Source & source,
|
|||
LocalStore::addToStore(info, source, repair, checkSigs);
|
||||
if (lowerStore->isValidPath(info.path)) {
|
||||
// dedup stores
|
||||
deletePath(toUpperPath(info.path));
|
||||
deletePath(toUpperPath(info.path)); // TODO: Investigate whether this can trigger 'stale file handle' errors.
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -214,6 +214,18 @@ StorePath LocalOverlayStore::addTextToStore(
|
|||
}
|
||||
|
||||
|
||||
void LocalOverlayStore::deleteGCPath(const Path & path, uint64_t & bytesFreed)
|
||||
{
|
||||
auto mergedDir = realStoreDir.get() + "/";
|
||||
if (path.substr(0, mergedDir.length()) != mergedDir) {
|
||||
warn("local-overlay: unexpected gc path '%s' ", path);
|
||||
return;
|
||||
}
|
||||
if (pathExists(toUpperPath({path.substr(mergedDir.length())}))) {
|
||||
GcStore::deleteGCPath(path, bytesFreed);
|
||||
}
|
||||
}
|
||||
|
||||
static RegisterStoreImplementation<LocalOverlayStore, LocalOverlayStoreConfig> regLocalOverlayStore;
|
||||
|
||||
}
|
||||
|
|
|
@ -122,6 +122,8 @@ private:
|
|||
|
||||
void queryRealisationUncached(const DrvOutput&,
|
||||
Callback<std::shared_ptr<const Realisation>> callback) noexcept override;
|
||||
|
||||
void deleteGCPath(const Path & path, uint64_t & bytesFreed) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue