From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id oFNTExb5/mRVcwEAauVa8A:P1 (envelope-from ) for ; Mon, 11 Sep 2023 13:25:10 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id oFNTExb5/mRVcwEAauVa8A (envelope-from ) for ; Mon, 11 Sep 2023 13:25: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 C6D4E61398 for ; Mon, 11 Sep 2023 13:25:09 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=hzJya5Ea; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1694431510; 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=X0/MgpbFzRUKOjghRU1in+s6M7paHhXd/XPRkQf1kKI=; b=iO7bEvS2F2TCO3Vkgkb6h3WltQ3mQ4fswBuStKMvBiFGpI3tJIp3f6Cco5lohIKPsyyhfe /brWr63wTuhOU7wweC0QA5atCq/7NEaU8YqqwVKPDkWPghPqG6nLg0ZUSv5rnDaz1Hnuwu Vb0U6fI/UqNH7RZZMIjELDuqzy2Bk0WmAEaULDiLT8738nLUMIAl3UsitJIfI19Agzd2Xk XnzHZ1aN2tzajE8B85BfGln+p4WNshNdNY5Tkoddo7aKb5gADz4ZAIVrv+m74QA4wBIxjk 0+zGuubQnD7OtHfYFjX/8AJR4lCAksk5t7fwlGj8gRgAFBK2okecZucQHmheWw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=hzJya5Ea; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1694431510; a=rsa-sha256; cv=none; b=BtKCdVAEqvNoLSgtrt24pAZDP85h0z148X1U36H4CYtv+BHugWtRT0tTZA/Nzh0qblgiPO aReQOLz7RuKQXzA/mQXoG9yZeZXvwJExO8Yky+BhiR8IgW/bwJRBSW34E23RJEcVdWKO8n gzzGA9Ocydpsq0MQhYOWBXG39zpOR3cWttFpHmykQjq98sOQ2Z6IQwXrStbxxmwwj4AZo8 wGoeZ11NibjJBQoyvPZ10rFPGM7ptBwf7TUoQiPO0R48UmzlQcVrge3t0rrdXV4NsCuw+2 dKs0MNmrUGrLnNq/+K8piM3+9D+nHhiN9J5M9MIAbJrYJUYtKral2i4blECfew== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qff2L-00060N-6Z; Mon, 11 Sep 2023 07:25:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qff2J-0005x2-JH for bug-guix@gnu.org; Mon, 11 Sep 2023 07:24:59 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qff2J-0006zT-BM for bug-guix@gnu.org; Mon, 11 Sep 2023 07:24:59 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qff2N-0007Sj-4L for bug-guix@gnu.org; Mon, 11 Sep 2023 07:25:03 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#65787: time-machine is doing too much network requests Resent-From: Simon Tournier Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 11 Sep 2023 11:25:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65787 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 65787@debbugs.gnu.org Received: via spool by 65787-submit@debbugs.gnu.org id=B65787.169443145628615 (code B ref 65787); Mon, 11 Sep 2023 11:25:03 +0000 Received: (at 65787) by debbugs.gnu.org; 11 Sep 2023 11:24:16 +0000 Received: from localhost ([127.0.0.1]:52244 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qff1b-0007RS-J8 for submit@debbugs.gnu.org; Mon, 11 Sep 2023 07:24:16 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:38254) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qff1X-0007R8-P2 for 65787@debbugs.gnu.org; Mon, 11 Sep 2023 07:24:13 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-401ef656465so13773925e9.1 for <65787@debbugs.gnu.org>; Mon, 11 Sep 2023 04:24:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694431442; x=1695036242; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=X0/MgpbFzRUKOjghRU1in+s6M7paHhXd/XPRkQf1kKI=; b=hzJya5EaU8FZZvQdAhV9upyF17pWcjb1lU1Fmn+0LNFUihFgxMDA/YMXWAbN5apGGP sbv5lben1W8SEXBto+edSavjb+aeTgoMEgoyWx0ln+7der8zs50inApCvdbWTa5qrSqR 44QIcv0/ik1+R3/+jyCnAFDNwNgon8IkpI0S5S+vNiSH6qp8Z+ypGrHb/7P2HyI3dCIZ SrzQ8rT/6wwXrqyinx9uk2j0rarmEoAqNgE1uUG8CAVKUg9aRWiFL5LvnzZrmM5oDyqo 9nO0EY/aERE2hMPoeDVAm2whKJjlVBfEkYiIjS0bZkI8aglhDbfkPqnoMAyL7U1h03bt +/0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694431442; x=1695036242; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X0/MgpbFzRUKOjghRU1in+s6M7paHhXd/XPRkQf1kKI=; b=aALBA9q9UzTktInBY8DYgKosmpcOaOhpNXLtxd5zllQtA9CVz2CVYMivNbBiymuRi5 KuzK0WtlCt9N21cgXNPjQ5874oEQBlkQh16cKPxAjtO+5b5FVhow8PUo7BuCRJpfFEgU gAaXyzemaZyklht4AZkybT8ZeSgvauIlkMk9uZbfhPnXP03fVfbcD3t0mx96zrKyxx8N TFUCq3v6p/q+o/MYiTnpSOgflCW8DqQk/CmFmmGQz7i0aIDyGdD5Pyth2omVe2WkS/gL 3nwEAIvkXh/yVtLJ/ewhVnPng4Ip155pbWgdbUZ2u8FkBWQ5ekDvEsqXx0aYagMUljAe uXUQ== X-Gm-Message-State: AOJu0YzL69xeyHEJZ6QNHlvBqyLibMGExe5/lQGuJL9Lj4jkr7KVkysg 49dXuAE0UKV3pEfniLLzbbttqd7mF+A= X-Google-Smtp-Source: AGHT+IEQ+qg85YX58lNzGeby/v7ORult2SMP7JhXK5EYTirMALC6Vq6hTP0XN/FEl7c5ZdKRkWvPoQ== X-Received: by 2002:a05:6000:3c4:b0:31f:a717:f1cc with SMTP id b4-20020a05600003c400b0031fa717f1ccmr2363727wrg.5.1694431441633; Mon, 11 Sep 2023 04:24:01 -0700 (PDT) Received: from pfiuh07 ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id q13-20020a05600000cd00b0031ad2f9269dsm9779316wrx.40.2023.09.11.04.24.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 04:24:01 -0700 (PDT) From: Simon Tournier In-Reply-To: <87zg1tvlfn.fsf@gnu.org> References: <87wmx3mfo5.fsf@gmail.com> <87zg1tvlfn.fsf@gnu.org> Date: Mon, 11 Sep 2023 11:41:54 +0200 Message-ID: <87tts1jbbx.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: C6D4E61398 X-Migadu-Scanner: mx1.migadu.com X-Migadu-Spam-Score: 5.78 X-Spam-Score: 5.78 X-TUID: R1s7GHwBk/f3 Hi Ludo, > Maybe this is the purpose of your message: > reducing Git remote accesses in those cases?=20 Yes. :-) On Sun, 10 Sep 2023 at 22:10, Ludovic Court=C3=A8s wrote: > It would probably be easier if you could come with > an example where there=E2=80=99s Git-related network traffic where there > shouldn=E2=80=99t. Do we agree that the both Guile-Git procedures =E2=80=99remote-fetch=E2=80= =99 and =E2=80=99branch-lookup=E2=80=99 are doing network traffic? If yes, here two examples: --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix pull -q -p /tmp/new Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.or= g/git/guix.git'... ;;; (remote-fetch NETWORK) ;;; (branch-lookup NETWORK) Authenticating channel 'guix', commits 9edb3f6 to 2eb6df5 (83 new commits).= .. Building from this channel: guix https://git.savannah.gnu.org/git/guix.git 2eb6df5 --8<---------------cut here---------------end--------------->8--- Well, that=E2=80=99s not perfect=E2=80=A6 it becomes much worse: --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix time-machine -q -- describe ;;; (remote-fetch NETWORK) ;;; (branch-lookup NETWORK) ;;; (remote-fetch NETWORK) ;;; (branch-lookup NETWORK) Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.or= g/git/guix.git'... ;;; (remote-fetch NETWORK) ;;; (branch-lookup NETWORK) building /gnu/store/z8jwdgr7z6i8c00msdm2kzfv0n3zp25v-module-import-compiled= .drv... --8<---------------cut here---------------end--------------->8--- Do we agree that is suboptimal? > =E2=80=98cached-channel-instance=E2=80=99 has 3 cases: > > 1. Obvious cache hit: This is when CHANNELS specifies the commit of > each target channel (this happens for example when you type =E2=80= =98guix > time-machine -q --commit=3Da4c35c607cfd7d6b0bad90cfcc46188d489e1754) > *and* the combination of channels is already in > ~/.cache/guix/inferiors. This is the optimal case: the Git repo > doesn=E2=80=99t even need to be opened. Yes. > 2. Cache hit: CHANNELS are pinned, but refer to tags (like =E2=80=9Cv1.= 2.0=E2=80=9D) > or short commit IDs (like =E2=80=9Ca4c35c6=E2=80=9D). In that case, > =E2=80=98channel-full-commit=E2=80=99 opens the Git repo to resolve = the identifier. > After that, we go to case #1 or #4. That=E2=80=99s suboptimal. Currently, it reads: --8<---------------cut here---------------start------------->8--- $ guix describe Generation 28 sept. 06 2023 14:54:50 (current) guix 6113e05 repository URL: https://git.savannah.gnu.org/git/guix.git commit: 6113e0529d61df7425f64e30a6bf77f7cfdfe5a5 $ ./pre-inst-env guix time-machine -q --commit=3D6113e05 -- describe ;;; (remote-fetch NETWORK) ;;; (remote-fetch NETWORK) Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.or= g/git/guix.git'... ;;; (remote-fetch NETWORK) Computing Guix derivation for 'x86_64-linux'... | C-c C-c --8<---------------cut here---------------end--------------->8--- Using patch from #65352 [1], it removes these useless traffic: --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix time-machine -q --commit=3D6113e05 -- describe Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.or= g/git/guix.git'... Computing Guix derivation for 'x86_64-linux'... | C-c C-c --8<---------------cut here---------------end--------------->8--- Using the proposed patch, it becomes optimal, IMHO. Well, let discuss it in #65352 =E2=80=93 comments are welcome. :-) > 3. Cache hit: CHANNELS are not pinned=E2=80=94i.e., they refer to a bra= nch, > not a commit. In that case we first need to perform a =E2=80=98git = fetch=E2=80=99 > and then we go to #1 or #4. I hope that I am convincing you that this case is suboptimal: it does 3 =E2=80=99git fetch=E2=80=99 and more 3 others lookup requiring network. So= it is about 6 network access when only one is necessary, IMHO. > 4. Cache miss: =E2=80=98reference-available?=E2=80=99 returns #f for th= e channel > commits, we got through =E2=80=98remote-fetch=E2=80=99 followed by > =E2=80=98build-derivations=E2=80=99. This case is part of #2 and discussed in #65352, IMHO. Cheers, simon 1: [bug#65352] [PATCH v2] DRAFT git: Avoid touching the network unless need= ed in 'reference-available?'. Simon Tournier Wed, 06 Sep 2023 16:17:08 +0200 id:32d3fb5066e0b20e200dabef0fba897634e21dda.1694009405.git.zimon.toutoune@g= mail.com https://yhetil.org/guix/32d3fb5066e0b20e200dabef0fba897634e21dda.1694009405= .git.zimon.toutoune@gmail.com https://issues.guix.gnu.org/msgid/32d3fb5066e0b20e200dabef0fba897634e21dda.= 1694009405.git.zimon.toutoune@gmail.com