From patchwork Wed Jan 3 06:22:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13509679 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B012C18053 for ; Wed, 3 Jan 2024 06:22:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="V7g+B+xF"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ToUNbGvU" Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id B78165C019A; Wed, 3 Jan 2024 01:22:19 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 03 Jan 2024 01:22:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1704262939; x=1704349339; bh=Fxf4ccFifo Mq7CopDOK6rkoC+1syMSYWoybI9T2OtC4=; b=V7g+B+xFuu5ronayLDUZ/W6V9E mTYMNd0oyR1W6q+tbm8OahMopx3VMNqa3K4i8CiJ2Rxa2juv1BS+OrNSo8snyL5Y aLdrDiCAQKK9J2nDGZJG8C/RKXJsb71ID/MauYgLIQJvH1/3fn3JsjRSPgEOalAN V+sYYIuOJwtEOme3bbyxWuz9+VTsw5RMqaFJa10oZG5BeT10ay+89WhN/c7hi+IC rzebiA9LgWeJiRfoV9U7IVdRDsDEGc5ZnsqlIs5tIgyL+YTQRKZF2McuhvVMGQyr sNygw5BOKbCymFWUgpqxoemADx3dUXOBTLZR+ROJ7ddOYN2IqkVsGx2phBsQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1704262939; x=1704349339; bh=Fxf4ccFifoMq7CopDOK6rkoC+1sy MSYWoybI9T2OtC4=; b=ToUNbGvUC9csq2XGb3fkIjQ4qY//TA/WEaIKRSR0naIk PBn9KSR2RaLihLGruRNCByx9lI7RmDJfmWQiYwqo+FTQ7QAj+zNm8p1WNzfO5Usk kt2ko4kQHSas2LYluIVKlj5Xosu8rhiz/v5RkXJe4erExSYgeDM78ll9noi3Ske1 PabGa6cmvFCbBQClaBRX5u8uvfbfqbV6W9oJ8xASENaiYGGrkW1gnMIFGUDe72YP 0NTY5AuObqRugCa/aY3Hg7psQhXQS2vk8sCVQcZashO+iiFmN/8PeBrepm+vDMUV ZNcrBX2+P+hS0WYivKesYhAa5Wf0TSmv4ePCq1/aWw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeggedgleeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvvefukfhfgggtuggjsehgtd erredttddvnecuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshes phhkshdrihhmqeenucggtffrrghtthgvrhhnpeeukedtvedtffevleejtefgheehieegke eluddvfeefgeehgfeltddtheejleffteenucevlhhushhtvghrufhiiigvpedunecurfgr rhgrmhepmhgrihhlfhhrohhmpehpshesphhkshdrihhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 3 Jan 2024 01:22:18 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id a9f7b756 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 3 Jan 2024 06:19:53 +0000 (UTC) Date: Wed, 3 Jan 2024 07:22:17 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Han-Wen Nienhuys , Junio C Hamano Subject: [PATCH v3 2/8] reftable/stack: do not auto-compact twice in `reftable_stack_add()` Message-ID: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: In 5c086453ff (reftable/stack: perform auto-compaction with transactional interface, 2023-12-11), we fixed a bug where the transactional interface to add changes to a reftable stack did not perform auto-compaction by calling `reftable_stack_auto_compact()` in `reftable_stack_addition_commit()`. While correct, this change may now cause us to perform auto-compaction twice in the non-transactional interface `reftable_stack_add()`: - It performs auto-compaction by itself. - It now transitively performs auto-compaction via the transactional interface. Remove the first instance so that we only end up doing auto-compaction once. Reported-by: Han-Wen Nienhuys Signed-off-by: Patrick Steinhardt --- reftable/stack.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/reftable/stack.c b/reftable/stack.c index 8729508dc3..7ffeb3ee10 100644 --- a/reftable/stack.c +++ b/reftable/stack.c @@ -425,9 +425,6 @@ int reftable_stack_add(struct reftable_stack *st, return err; } - if (!st->disable_auto_compact) - return reftable_stack_auto_compact(st); - return 0; }