From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id qLBIGNaa22IL/QAAbAwnHQ (envelope-from ) for ; Sat, 23 Jul 2022 08:53:10 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id mIhdGNaa22KmmQAA9RJhRA (envelope-from ) for ; Sat, 23 Jul 2022 08:53:10 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CCAC32C6A9 for ; Sat, 23 Jul 2022 08:53:09 +0200 (CEST) Received: from localhost ([::1]:37024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oF90d-0001bn-LF for larch@yhetil.org; Sat, 23 Jul 2022 02:53:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56406) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oF90Y-0001bR-3R for guix-patches@gnu.org; Sat, 23 Jul 2022 02:53:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53293) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oF90X-0002To-R1 for guix-patches@gnu.org; Sat, 23 Jul 2022 02:53:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oF90X-0008Jc-Me for guix-patches@gnu.org; Sat, 23 Jul 2022 02:53:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#51427] [PATCH] nix: libstore: Do not remove unused links when deleting specific items. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 23 Jul 2022 06:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51427 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Maxime Devos Cc: 51427@debbugs.gnu.org, Tobias Geerinckx-Rice , maxim.cournoyer@gmail.com, zimon.toutoune@gmail.com Received: via spool by 51427-submit@debbugs.gnu.org id=B51427.165855917031947 (code B ref 51427); Sat, 23 Jul 2022 06:53:01 +0000 Received: (at 51427) by debbugs.gnu.org; 23 Jul 2022 06:52:50 +0000 Received: from localhost ([127.0.0.1]:43042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oF90M-0008JA-6G for submit@debbugs.gnu.org; Sat, 23 Jul 2022 02:52:50 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:35803) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oF90K-0008It-8z for 51427@debbugs.gnu.org; Sat, 23 Jul 2022 02:52:48 -0400 Received: by mail-ed1-f66.google.com with SMTP id e15so8096193edj.2 for <51427@debbugs.gnu.org>; Fri, 22 Jul 2022 23:52:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=YiBjDBznBy6nkk17IcnxVdxzcg2FqeIAB/dAu2g/zlY=; b=nIHj7dHiRxnHzcc5tXhivJuvgdBPFlt2kGY/DBNJ+HcjWUGussioApIPW2odNh3XVQ /NUpdTD1iqX7eLRAsTdXtgcNSAU5uFSfDqWH9yLKKqTK//lSePtihbFz6JQNUILW2TZz 1l4Qdt9aUszgixW38iGqWUAY0Q2LcYt7fNShxmWdMUSj93ziKhaJsIiJyDWyDkts4yoB RloKS5QRvp8zy2dbcU7z18+iaJyUd7XYhhxWi5cSAxxJEBNOGxuAk9MxCO76nmANq0uX RJxOpDZ9z0i4GlVrKyXuCp/xfhzkTylayVbZX8RnkhDIx9OiMHcXWuRGsERtAbvI8w2E rSaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=YiBjDBznBy6nkk17IcnxVdxzcg2FqeIAB/dAu2g/zlY=; b=2P8IrCvsvivezj+wVcrwjCjmLFOSFpQYXICHkhP5WjZXuMBpgcoFZL5H16Wu91c8FH tfhg7cQbhasuyf0u90HVCmEPsjHR7RgdtIbc4kgFvW65ucBHewjEFQBtcc3xpAMb8spV s0X54KUVI1HyGrYCJL8MzCa0ZLhoj0CsbsSJtQ9W+PrbWrSFMRj6Yqz8/vato2l/omHO gwEQm7VYdLhdbkRZt8C9c2OdZI10miFnpvKb3lqqmZMDQsR7Pmo4upt5AGK7tM6/z+YL dnuN4nKb25IKJJwnkwrq9afExkHvxOsMAPpkki/HS7WbmhbVZ/8nLzoM4UyS7uxWw0fQ 16YA== X-Gm-Message-State: AJIora8tyfr4T1lwIWAh3hQ1GtuQiaBkN2nXuas5f/yUPfWNw6Yd385w O8a9iqTF3I2ZgQEodGBpTqU= X-Google-Smtp-Source: AGRyM1uf4q9aojWUXBYi+5Ls9D1R2dZUKR+r3P9tJkXtFdSHP6ovpEoA7XcDpUA2EqNAYDg5/IDJsw== X-Received: by 2002:a05:6402:1767:b0:43b:a844:14f with SMTP id da7-20020a056402176700b0043ba844014fmr3214075edb.131.1658559162233; Fri, 22 Jul 2022 23:52:42 -0700 (PDT) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id ga2-20020a170906b84200b00724261b592esm2798272ejb.186.2022.07.22.23.52.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jul 2022 23:52:41 -0700 (PDT) Message-ID: From: Liliana Marie Prikler Date: Sat, 23 Jul 2022 08:52:40 +0200 In-Reply-To: <874jz8eogx.fsf@gnu.org> References: <20211027034918.4591-1-maxim.cournoyer@gmail.com> <87o8795j61.fsf@gnu.org> <5c2dd60acfaa7d74b7554babb3e223bc855bac8a.camel@gmail.com> <87h7cxp9tl.fsf@gnu.org> <87sfwg7w9z.fsf@gmail.com> <87ee7tmdbd.fsf@gnu.org> <86k0hhnqss.fsf@gmail.com> <871r3f2j7y.fsf@gnu.org> <867dd7roi2.fsf@gmail.com> <87o7xmy14l.fsf_-_@gnu.org> <2441c768fea8faee800947a17aef896c35173845.camel@gmail.com> <87sfmxv6ue.fsf@gnu.org> <8538dc9925eb499ea2b728e349d98296eedeb14d.camel@gmail.com> <877d48lx41@nckx> <877d46n7n5.fsf_-_@gnu.org> <12c768df412e23b4d69e87631cd805f741c38ce3.camel@gmail.com> <87ilnpibu1.fsf@gnu.org> <4b81f06f-3e89-5a33-ae30-1710e447f849@telenet.be> <874jz8eogx.fsf@gnu.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1658559190; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=YiBjDBznBy6nkk17IcnxVdxzcg2FqeIAB/dAu2g/zlY=; b=AvqQbD8tqbZ3mJV2syoTd7eIZoBP85OrlelQolpP0cLtKkQ7CSfhjYwLVmGFmmNytPw+/8 qoXWbPzthvputGgqfurKBoJEP1mfCMUyl2H/GmrYQuKJhWYrg4EoD1Uws3f5LUa9fZAhIA uFOiXLUzBQVNxm8qvkcNeDeAJFVHHXHuLQyQ/oJP2uv9rcp9tUafgKyLumTWya4yN40bvr cKok2uNxn23NYBWOCNkBLtBuClA9i5Y89kuRS4jByaHpD2PMqZMudPntXrGADgBXM7/2WT OrpTdTEs9ahhxcgf6jjZQLHMbdhYqH+zr9RbxhewX3id5pQTS0d7hQaJ8sS4AA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1658559190; a=rsa-sha256; cv=none; b=t9dtE47/I+tzlB/nG1wH57Q6lMReohsEQCDaxMmsDxUwY/pJpRmSQEaZV5SvAsqpI1tI4z csgqd0qmrYdmRSuOEnZDcPOsqEWkjEatCEvIYxGetFFXuYk7WFKAjvlz5nimatMztEz2dr mNcnPzQBD91An5HbnoY/6CHyHeckem9OUVp045PDy+yh/pH9htmol7jr4Tq+Fq7MRNolNp suwbTPvgnS2zaA+mQB0Hvv8zQCU1r39zP4Qduz50/WZPIcdVZiaqaAho20a4ZOEFH6Rbe1 YWU+upJfyr5zwaXsLVKbu7h11O3I+ez/LqeYL51H054FXFzmqfR28+y4tu03EA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=nIHj7dHi; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 6.76 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=nIHj7dHi; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: CCAC32C6A9 X-Spam-Score: 6.76 X-Migadu-Scanner: scn0.migadu.com X-TUID: hvlTjRU4MOh1 Am Samstag, dem 23.07.2022 um 01:07 +0200 schrieb Ludovic Courtès: > Hi, > > Maxime Devos skribis: > > > On 22-07-2022 14:14, Ludovic Courtès wrote: > > > Hi, > > > > > > Liliana Marie Prikler  skribis: > > > > > > > I don't think deleting links will ever be fast on that disk.  > > > > But what I've been saying the whole time is that I don't always > > > > need the links deleted.  I think adding "expert" switches to > > > > skip these phases might actually be enough – after all, if I > > > > ever do want to run a full GC, the information ought to be the > > > > same, no? > > > The expert will have to know that skipping that phase will have > > > the effect of *not* freeing space on the device, so… > > > > I believe the word "expert" implies that the expert knows that, > > Apologies for being elliptic.  My point here, as has been discussed > earlier in this thread, is that we can’t just skip that phase or we’d > simply leave files around without actually deleting them. > > Thus, a command-line switch to skip the phase doesn’t seem valuable > to me because it’d let users run the GC in a way that doesn’t > actually collect garbage. > > I hope this is clearer! As noted before, I don't always run GC to free up X amount of space. Even if I did, link deletion is greedy and frees up whatever it can. So the initial suggestion to only look at what might have been freed in this gc already makes sense. However, it was ruled complicated because the GC is implemented in C++.   My personal motivation to just skip the phase entirely comes from the hypothesis that the store is in a sane state even if the links are not deleted. Particularly, if I `guix gc broken-item' and `guix build broken-item', even without deleting links, the broken-item should now be fixed. This has practical advantages over `guix build --repair': if the last `guix package' or `guix system' failed mid-way, any user, not just root, can simply `guix gc' the broken items. Now, I understand that as a default, you never want to skip this phase, because it doesn't actually free up disk space. But if you have a slow disk with large space, do you really need to free all that much space, or would it be fine to delay freeing it until a later date? Cheers