aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/gc.cc
AgeCommit message (Collapse)Author
2009-11-24* Randomise the order in which we delete entries to make the collectorEelco Dolstra
less biased towards deleting paths that come alphabetically first (e.g. /nix/store/000...). This matters when using --max-freed etc.
2009-11-23(no commit message)Eelco Dolstra
2009-11-23* `nix-store --gc --print-roots': also print the path of the actualEelco Dolstra
root symlink, not just its target. E.g.: /nix/var/nix/profiles/system-99-link -> /nix/store/76kwf88657nq7wgk1hx3l1z5q91zb9wd-system
2009-11-23* Made the garbage collector a lot faster. It no longer computes theEelco Dolstra
complete set of live and dead paths before starting the actual deletion, but determines liveness on demand. I.e. for any path in the store, it first tries to delete all the referrers, and then the path itself. This means that the collector can start deleting paths almost immediately.
2009-11-20* Remove the --use-atime / --max-atime garbage collector flags. ManyEelco Dolstra
(Linux) machines no longer maintain the atime because it's too expensive, and on the machines where --use-atime is useful (like the buildfarm), reading the atimes on the entire Nix store takes way too much time to make it practical.
2009-04-21* Use foreach in a lot of places.Eelco Dolstra
2009-03-26* Don't use ULLONG_MAX in maxFreed - use 0 to mean "no limit".Eelco Dolstra
18446744073709551615ULL breaks on GCC 3.3.6 (`integer constant is too large for "long" type').
2008-12-12* Put chroots in the Nix store. This ensures that we can create hardEelco Dolstra
links to the inputs.
2008-12-12* Simplify deleting .lock files in /nix/store: just don't delete themEelco Dolstra
if they belong a path that's currently being built. This gets rid of some Cygwin-specific code.
2008-09-17* GC option `--max-atime' that specifies an upper limit to the lastEelco Dolstra
accessed time of paths that may be deleted. Anything more recently used won't be deleted. The time is specified in time_t, e.g. seconds since 1970-01-01 00:00:00 UTC; use `date +%s' to convert to time_t from the command line. Example: to delete everything that hasn't been used in the last two months: $ nix-store --gc -v --max-atime $(date +%s -d "2 months ago")
2008-09-17* Typo.Eelco Dolstra
2008-09-17* Some refactoring. Better output with `-v' for --use-atime.Eelco Dolstra
2008-09-17* Garbage collector: added an option `--use-atime' to delete paths inEelco Dolstra
order of ascending last access time. This is useful in conjunction with --max-freed or --max-links to prefer deleting non-recently used garbage, which is good (especially in the build farm) since garbage may become live again. The code could easily be modified to accept other criteria for ordering garbage by changing the comparison operator used by the priority queue in collectGarbage().
2008-08-14* Increase the sleep periods a bit to make the test less likely toEelco Dolstra
fail on slow machines. Of course it would be better if this test wasn't timing dependent...
2008-06-18* Garbage collector: option `--max-freed' to stop after at least NEelco Dolstra
bytes have been freed, `--max-links' to stop when the Nix store directory has fewer than N hard links (the latter being important for very large Nix stores on filesystems with a 32000 subdirectories limit).
2008-06-18* Some refactoring: put the GC options / results in separate structs.Eelco Dolstra
* The garbage collector now also prints the number of blocks freed.
2008-06-14* Note.Eelco Dolstra
2008-06-13* Garbage collector: don't do a complete topological sort of the NixEelco Dolstra
store under the reference relation, since that means that the garbage collector will need a long time to start deleting paths. Instead just delete the referrers of a path first.
2008-06-13* Print some progress info during the early GC stages.Eelco Dolstra
2008-06-09* Merged the no-bdb branch (-r10900:HEADEelco Dolstra
https://svn.nixos.org/repos/nix/nix/branches/no-bdb).
2007-11-29* nix-env -e: support uninstalling by path, so that one can sayEelco Dolstra
$ nix-env -e $(which firefox) or $ nix-env -e /nix/store/nywzlygrkfcgz7dfmhm5xixlx1l0m60v-pan-0.132 * nix-env -i: if an argument contains a slash anywhere, treat it as a path and follow it through symlinks into the Nix store. This allows things like $ nix-build -A firefox $ nix-env -i ./result * nix-env -q/-i/-e: don't complain when the `*' selector doesn't match anything. In particular, `nix-env -q \*' doesn't fail anymore on an empty profile.
2007-11-15* Don't need gc.hh.Eelco Dolstra
2007-11-15Added possibility to specify garbage collection levels for store paths; so ↵Michael Raskin
packages can share intermediate results of compilation and GC will collect it automatically while never touching tarballs, for example.
2007-08-28* PathLocks::lockPaths: don't allow reacquiring a lock we alreadyEelco Dolstra
hold.
2007-08-12* Get rid of the substitutes database table (NIX-47). Instead, if weEelco Dolstra
need any info on substitutable paths, we just call the substituters (such as download-using-manifests.pl) directly. This means that it's no longer necessary for nix-pull to register substitutes or for nix-channel to clear them, which makes those operations much faster (NIX-95). Also, we don't have to worry about keeping nix-pull manifests (in /nix/var/nix/manifests) and the database in sync with each other. The downside is that there is some overhead in calling an external program to get the substitutes info. For instance, "nix-env -qas" takes a bit longer. Abolishing the substitutes table also makes the logic in local-store.cc simpler, as we don't need to store info for invalid paths. On the downside, you cannot do things like "nix-store -qR" on a substitutable but invalid path (but nobody did that anyway). * Never catch interrupts (the Interrupted exception).
2007-06-12* Support queryDeriver() in multi-user installations.Eelco Dolstra
2007-06-11* Check against creation of GC roots in the store. Those roots don'tEelco Dolstra
work, because findRoots() stops when it encounters a symlink to the store. And of course the store is supposed to be read-only.
2007-03-19* Undocumented option `gc-check-reachability' to allow reachabilityEelco Dolstra
checking to be turned off on machines with way too many roots.
2007-02-21* `nix-store -qR' and friends: print the paths sorted topologicallyEelco Dolstra
under the references relation. This is useful for commands that want to copy paths to another Nix store in the right order.
2007-01-14* Make the garbage collector more resilient to certain consistencyEelco Dolstra
errors: in-use paths now cause a warning, not a fatal error.
2006-12-05* Better message.Eelco Dolstra
2006-12-05* Allow unprivileged users to run the garbage collector and to doEelco Dolstra
`nix-store --delete'. But unprivileged users are not allowed to ignore liveness. * `nix-store --delete --ignore-liveness': ignore the runtime roots as well.
2006-12-05* The determination of the root set should be made by the privilegedEelco Dolstra
process, so forward the operation. * Spam the user about GC misconfigurations (NIX-71). * findRoots: skip all roots that are unreadable - the warnings with which we spam the user should be enough.
2006-12-05* findRoots: return a map from the symlink (outside of the store) toEelco Dolstra
the store path (inside the store).
2006-12-05* In addPermRoot, check that the root that we just registered can beEelco Dolstra
found by the garbage collector. This addresses NIX-71 and is a particular concern in multi-user stores.
2006-12-04* Add indirect root registration to the protocol so that unprivilegedEelco Dolstra
processes can register indirect roots. Of course, there is still the problem that the garbage collector can only read the targets of the indirect roots when it's running as root...
2006-12-02* Move addTempRoot() to the store API, and add another functionEelco Dolstra
syncWithGC() to allow clients to register GC roots without needing write access to the global roots directory or the GC lock.
2006-12-02* Remove SwitchToOriginalUser, we're not going to need it anymore.Eelco Dolstra
2006-11-30* Refactoring. There is now an abstract interface class StoreAPIEelco Dolstra
containing functions that operate on the Nix store. One implementation is LocalStore, which operates on the Nix store directly. The next step, to enable secure multi-user Nix, is to create a different implementation RemoteStore that talks to a privileged daemon process that uses LocalStore to perform the actual operations.
2006-11-24* Doh! Path sizes need to be computed recursively of course.Eelco Dolstra
(NIX-70)
2006-09-14* Fix a huge gaping hole in nix-env w.r.t. the garbage collector.Eelco Dolstra
Nix-env failed to call addPermRoot(), which is necessary to safely add a new root. So if nix-env started after and finished before the garbage collector, the user environment (plus all other new stuff) it built might be garbage collected, leading to a dangling symlink chain in ~/.nix-profile... * Be more explicit if we block on the GC lock ("waiting for the big garbage collector lock..."). * Don't loop trying to create a new generation. It's not necessary anymore since profiles are locked nowadays.
2006-09-04* Use a proper namespace.Eelco Dolstra
* Optimise header file usage a bit. * Compile the parser as C++.
2006-08-11* `nix-store --gc --print-dead': print the total size of the storeEelco Dolstra
objects that would be freed.
2006-08-11* Don't assume that paths returned by the runtime root finder areEelco Dolstra
valid.
2006-07-20* Use $(libexecdir) to find find-runtime-roots.pl.Eelco Dolstra
2006-07-20* Use debug().Eelco Dolstra
2006-07-20* Call find-runtime-roots.pl from the garbage collector to preventEelco Dolstra
running applications etc. from being garbage collected.
2006-06-20* Concurrent GC on Cygwin.Eelco Dolstra
2006-05-29* Disable the concurrent garbage collector on Cygwin for now.Eelco Dolstra
2006-05-11* 64-bit compatibility fixes (for problems revealed by building on an AthlonEelco Dolstra
64 running 64-bit SUSE). A patched ATerm library is required to run Nix succesfully.