guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#51427] [PATCH] nix: libstore: Do not remove unused links when delet


From: Ludovic Courtès
Subject: [bug#51427] [PATCH] nix: libstore: Do not remove unused links when deleting specific items.
Date: Sat, 06 Nov 2021 17:57:58 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Hi Maxim and all,

Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:

> Ludovic Courtès <ludo@gnu.org> writes:

[...]

>> You seem to be proposing to remove ‘-D’ altogether.  I agree it has the
>> shortcomings you write, but I think it’s occasionally useful
>> nonetheless.
>>
>> My proposal would be either the status quo, or removing just the one
>> link that matters from /gnu/store/.links upon ‘-D’.
>
> The second proposal makes sense.

Maybe that proposal is bogus though because you’d need to know the hash
of the files being removed, which means reading them…

> I didn't care about freeing space, as my use case was getting around
> corrupting an item in my store due to
> https://issues.guix.gnu.org/51400, which the patch proposed here
> allowed me to do without wasting hours of cleaning up links (nearly 1
> GiB of store on spinning drives).

The ideal solution as zimoun writes would be to address
<https://issues.guix.gnu.org/24937>.

Perhaps that phase needs to be implemented using a different strategy,
say an sqlite database that records the current link count (hoping that
‘SELECT * FROM links WHERE NLINKS = 1’ would be faster than traversing
all of ‘.links’) as well as a mapping from store item to file hashes.

BTW, those using Btrfs can probably use ‘--disable-deduplication’ and be
done with it.

Thanks,
Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]