1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-21 17:59:36 +01:00

`nix-store --verify' improvements:

* If a path has disappeared, check its referrers first, and don't try
  to invalidate paths that have valid referrers.  Otherwise we get a
  foreign key constraint violation.
* Read the whole Nix store directory instead of statting each valid
  path, which is slower.
* Acquire the global GC lock.
This commit is contained in:
Eelco Dolstra 2010-08-31 11:47:31 +00:00
parent 80e722278c
commit e2e168f7c2
3 changed files with 62 additions and 20 deletions

View file

@ -5,6 +5,7 @@
#include "store-api.hh"
#include "util.hh"
#include "pathlocks.hh"
class sqlite3;
@ -16,8 +17,8 @@ namespace nix {
/* Nix store and database schema version. Version 1 (or 0) was Nix <=
0.7. Version 2 was Nix 0.8 and 0.9. Version 3 is Nix 0.10.
Version 4 is Nix 0.11. Version 5 is Nix 0.12-0.14. Version 6 is
Nix 0.15. */
Version 4 is Nix 0.11. Version 5 is Nix 0.12-0.16. Version 6 is
Nix 1.0. */
const int nixSchemaVersion = 6;
@ -233,6 +234,9 @@ private:
void invalidatePath(const Path & path);
void verifyPath(const Path & path, const PathSet & store,
PathSet & done, PathSet & validPaths);
void upgradeStore6();
PathSet queryValidPathsOld();
ValidPathInfo queryPathInfoOld(const Path & path);
@ -244,6 +248,8 @@ private:
bool isActiveTempFile(const GCState & state,
const Path & path, const string & suffix);
int openGCLock(LockType lockType);
void startSubstituter(const Path & substituter,
RunningSubstituter & runningSubstituter);