Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wBvP3-001VHV-23 for pgsql-hackers@arkaria.postgresql.org; Sun, 12 Apr 2026 14:03:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wBvP1-002TkN-2t for pgsql-hackers@arkaria.postgresql.org; Sun, 12 Apr 2026 14:03:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wBvP0-002TkE-2Y for pgsql-hackers@lists.postgresql.org; Sun, 12 Apr 2026 14:03:08 +0000 Received: from fout-b3-smtp.messagingengine.com ([202.12.124.146]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wBvOy-00000000g2D-25B5 for pgsql-hackers@lists.postgresql.org; Sun, 12 Apr 2026 14:03:07 +0000 Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfout.stl.internal (Postfix) with ESMTP id 8F2F91D0007E; Sun, 12 Apr 2026 10:03:01 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Sun, 12 Apr 2026 10:03:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-transfer-encoding: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=1776002581; x=1776088981; bh=iA0zA/oTG9bjM/RgM3QAEleaC5MRS0ojVLZKPHaM3Y0=; b= S5gk/aYf+KH9BbbahLxVqcjh88GSzraKrPaTSW1FDu8EZCP4n4Jj5fFgTyHXkeEu u1A70xbcRJTFl99X2CYIxyjtrloYH7uZTZsnmbSn4u3YSPVXruYwxEyO2Teew4ss Me82RWf9pBw02YLrMQefLhNRG4lRdgzx2jygE3/nNaER27EJPjN4PovBTmcmtIj5 QYf9xAT6hIdN43xKHxeNwUwS3zVH0xcc9RypkqAf4Y7/7BF/C7DjRTBm6k0YfbJB y2jRYPboF73fo/K3MDetGPOqG/OQEmB6t0Opz+/Gb8bMp8d98NfzXTUQAXYG9b9g z20bfvSpMg85v3TN+5c2wA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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-sender:x-me-sender:x-sasl-enc; s=fm2; t=1776002581; x= 1776088981; bh=iA0zA/oTG9bjM/RgM3QAEleaC5MRS0ojVLZKPHaM3Y0=; b=p eWER4HHwyDGSG48BnIHoP2RAhjkitPwqMkjQxetM7oLJJgqL0i9olRPpJrIjzfVP 46aJxiQa3Tnt0ReuJi2K9WsunbG7wcja9pBgdeaX/MyyMVls7iHTUJWLUyP3f5QV H/jlSONKxoGFa4DQPUDQIEzkD1FrkIR2wMAgBeR7mKWvhr3yeVbmv8OX2phPRseQ EwOH1H0ScA49w72xhkL82pQqyG6HuyYSFnxaM/cfIG6iVmfDkJz3T6qFdgmIidvV xU6H2P7qp+ocqIfj72HKmYWvR2sEIV9DguBSidrXzz7fUG2z9SEO9ylh6DlhH/JM Ax/9/qKiRZuUbFw72gBpw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdefheeglecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfhfgggtugfgjgestheksfdttddtjeenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrfgrth htvghrnheptdelledvgfejvdffieeukeefueelfffhgeffhffgffekveeuheeihefhiefg hfdvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hnughrvghssegrnhgrrhgriigvlhdruggvpdhnsggprhgtphhtthhopeekpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprd horhhgpdhrtghpthhtoheprghhsegthigsvghrthgvtgdrrghtpdhrtghpthhtoheprghm ihhtrdhkrghpihhlrgduieesghhmrghilhdrtghomhdprhgtphhtthhopegsohgvkhgvfi hurhhmodhpohhsthhgrhgvshesghhmrghilhdrtghomhdprhgtphhtthhopehmihhhrghi lhhnihhkrghlrgihvghusehgmhgrihhlrdgtohhmpdhrtghpthhtohepshhrihhnrghthh dvudeffeesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhs sehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehrohgsseigii hilhhlrgdrnhgvth X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 12 Apr 2026 10:03:00 -0400 (EDT) Date: Sun, 12 Apr 2026 10:02:59 -0400 From: Andres Freund To: Robert Treat Cc: Antonin Houska , Amit Kapila , Mihail Nikalayeu , Alvaro Herrera , Srinath Reddy Sadipiralla , Matthias van de Meent , Pg Hackers Subject: Re: Adding REPACK [concurrently] Message-ID: References: <202604062213.cgo352cdsgsm@alvherre.pgsql> <4n4q3preb3lgyhpzstebhux7b2aojhsw7gik4ivaznyggiezrs@lrznutssxlh2> <9539.1775724194@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2026-04-10 12:14:59 -0400, Robert Treat wrote: > On Thu, Apr 9, 2026 at 10:20 AM Andres Freund wrote: > > > Anti-wraparound (failsafe) VACUUM is a bit different case [1] (i.e. it should > > > possibly have higher priority than REPACK), but I think this prioritization > > > should be implemented in other way than just letting it get in the way of > > > REPACK (at the time REPACK is nearly finished). > > > > Yea, it makes no sense to interrupt the long running repack, given that the > > new relation will have much less stuff for vacuum to do. > > > > We might be talking about 2 different scenarios. In the case where we > are at the point of lock escalation, you would probably want the > repack to get priority over a waiting vacuum, even a failsafe vacuum. > But outside of that scenario, we can't know that the repack is the > better option (and statistically it probably isn't) since a repack > that is actively copying rows might still need to rebuild some large > number of indexes (or just some really expensive index) which could > take significantly longer than a failsafe vacuum would need to ensure > wraparound avoidance. I don't really understand why you consider REPACK CONCURRENTLY to be so different from other existing long-running operations? > I don't think we'd go as far as saying the failsafe vacuum should cancel the > repack, but I think ideally we'd like it to not be canceled either I don't think what I suggested could lead to (auto-)vacuum getting cancelled? Antonin's earlier patch could, but as long as you only do cancellations if there's an actual deadlock cycle, VACUUM should not get cancelled, since it won't already hold a lower level lock? > , since that would increase likelihood for dba/monitoring to pick up on the > situation, and in the case that REPACK fails for some reason, the failsafe > vacuum could immediately start working without having to go through any > additional hoops. Not sure I buy this (leaving aside the premise doesn't hold, I think). If you have monitoring for either long running tasks or tables not getting autovacuumed, it'd pick up on that regardless of whether autovacuum is getting cancelled or not. What realistic monitoring would pick up on autovacuum just being stuck waiting for a lock for long, but would not pick up on repack running forever or age(datfrozenxid) getting a bit long in the tooth? Greetings, Andres Freund