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 1wACy4-002ALW-0u for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Apr 2026 20:24:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wACy2-002Kj8-0w for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Apr 2026 20:24:10 +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 1wACy2-002Kiz-00 for pgsql-hackers@lists.postgresql.org; Tue, 07 Apr 2026 20:24:10 +0000 Received: from fout-b6-smtp.messagingengine.com ([202.12.124.149]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wACxz-00000001Axx-1pIT for pgsql-hackers@lists.postgresql.org; Tue, 07 Apr 2026 20:24:10 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.stl.internal (Postfix) with ESMTP id B10C41D001BE; Tue, 7 Apr 2026 16:24:05 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Tue, 07 Apr 2026 16:24:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; 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=1775593445; x=1775679845; bh=Q274SMs3kC +Z7j5qkhlaj4y0cmVDlfeZbtw5rVyujlo=; b=oUA2JD7RQT34tHg9QuCdWh6NNx 7PJPXVca3+bUOv2aIKtuMeZcnTlvBGU8J7C5V0NAfFiXwe0d65KeB5GlwqKN+sJC OftLLXI+OrL6X2IU75/HQG2FlDci0IWsJwGgVMPPJXOMcTT8trpeKjkidisfRXxK xLbKqfHuxXjzbz9Jtp5S/UDT3jAja2vrQ9rOrMVIBdEbbYLUlamEvqPRe6vTMiL+ jVb5Jk9UNdvPY06uq0DKyVjMeCsTxur9WkW5cTgDEMkxQFg45EJXLul+YbN5qacm 4WetHHWlLHJpT+n9qykDFKibnXuhKr1qkerk75AzU7FMqoUINa+PEbkaRFLA== 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-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1775593445; x=1775679845; bh=Q274SMs3kC+Z7j5qkhlaj4y0cmVDlfeZbtw 5rVyujlo=; b=pII/ZcIvXxHa1HSJ2WlJccK2okw770bOD5rO3X4/1RSf+4q1hKZ zqWbY+2ZdFCmi9VhUEZ1I8Pp85XRMMhEkLhTbXqmIN5trrOaSf98pQ1+sBzfwBEh W6woh4WiIcOLW0OCvA/5AZoiOYgwXxBjg1JgUpKkHfyqd/cAW0nsKSsnnEtpNTVx GaCUpKtujIqohA/Nnhini96AjOWUJn76qNJwcBhzYfS+K8Z9IfJywInGDBLhZdMp 61g+GZNqIYWE08rKnyAW1zbeYpXMFBxIzwsnwjOAWxJ6Ofss+z0wGAsZUPqs5XXl cWZrt5al0uHR99bQfmALnrHQkV+WF/tdVCg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgddvudeiudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfhfgggtuggjsehttdfstddttddvnecuhfhrohhmpeetnhgurhgvshcu hfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrghtth gvrhhnpeeffffgledvffegtdevlefgtdeggffhvdekgfegteeiveejkeetudelveejhfeu geenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnh gurhgvshesrghnrghrrgiivghlrdguvgdpnhgspghrtghpthhtohepkedpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtoheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdroh hrghdprhgtphhtthhopegrhhestgihsggvrhhtvggtrdgrthdprhgtphhtthhopegrmhhi thdrkhgrphhilhgrudeisehgmhgrihhlrdgtohhmpdhrtghpthhtohepsghovghkvgifuh hrmhdophhoshhtghhrvghssehgmhgrihhlrdgtohhmpdhrtghpthhtohepmhhihhgrihhl nhhikhgrlhgrhigvuhesghhmrghilhdrtghomhdprhgtphhtthhopehsrhhinhgrthhhvd dufeefsehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrshes lhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtoheprhhosgesgiiiih hllhgrrdhnvght X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 7 Apr 2026 16:24:04 -0400 (EDT) Date: Tue, 7 Apr 2026 16:24:04 -0400 From: Andres Freund To: Alvaro Herrera Cc: Mihail Nikalayeu , Antonin Houska , Srinath Reddy Sadipiralla , Amit Kapila , Matthias van de Meent , Pg Hackers , Robert Treat Subject: Re: Adding REPACK [concurrently] Message-ID: <4n4q3preb3lgyhpzstebhux7b2aojhsw7gik4ivaznyggiezrs@lrznutssxlh2> References: <202604062213.cgo352cdsgsm@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202604062213.cgo352cdsgsm@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2026-04-07 00:22:32 +0200, Alvaro Herrera wrote: > From 4303eea0a72408183f9f5afcf8d2801df20f8ffe Mon Sep 17 00:00:00 2001 > From: Antonin Houska > Date: Wed, 1 Apr 2026 17:35:47 +0200 > Subject: [PATCH v56 3/3] Error out any process that would block at REPACK > > Any process waiting on REPACK to release its lock would actually cause > it to deadlock when it tries to upgrade its lock to AEL, losing all work > done to that point. We avoid this by teaching the deadlock detector to > raise an error when this condition is detected. I'm rather doubtful that that is ok. Won't this make it basically unsafe to use repack in way way too many situations? If sessions start erroring out, rather than wait, because they briefly lock a relation or such it'll imo make this rather unsafe in production. ISTM that the proper fix here might be to allow repack to do a lock upgrade that jumps to the front of the lock's wait queue. The lock upgrade is the reason for the deadlock, right? And the reason it will often cause a deadlock is that the repack will be at the tail, rather than the front of the wait queue. So let's fix that. Jumping the queue won't make the lock upgrade immediately, of course, but I think it would fix the issue of the repack, rather than some other process, getting cancelled? Greetings, Andres Freund