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.98.2) (envelope-from ) id 1x9fkw-000000029zI-0BUR for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Sep 2026 09:28:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1x9fku-0000000AcYP-3R1P for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Sep 2026 09:28:40 +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.98.2) (envelope-from ) id 1x9fku-0000000AcYG-2Fm0 for pgsql-hackers@lists.postgresql.org; Thu, 24 Sep 2026 09:28:40 +0000 Received: from mail-wm2-x10.google.com ([2a00:1450:4864:31::10]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1x9fkq-0000000125Z-18Dm for pgsql-hackers@postgresql.org; Thu, 24 Sep 2026 09:28:39 +0000 Received: by mail-wm2-x10.google.com with SMTP id 5b1f17b1804b1-49e620fa473so10985305e9.1 for ; Thu, 24 Sep 2026 02:28:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790242115; x=1790846915; darn=postgresql.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=HjF34qZSn4LgZAXLth1PNUz23kb06ygCvrmIzbiAeOs=; b=sINef53Qf67AQe15KRHyHb+XoVOAVXaiFT6Op6dHPVi9yLqfwBFF7XbFsEhuEH15+z odhHJmx0QRSYnNWWZOUhmgpQ2CWtLbSXDqx73nn1egswnJfQqpMr1tWtmBN90RWcYb+f cmrveiQPkQt5qaYgzszcHwLR+LFcyd6ccnpZrjAYEBrbQLSdZmhwu7F+Z66exeWy9gWJ gbvDNL7yHR04sDJLj82eGyEXww1DiQlwAq57xmiuIK4xlYvnGhPibwPCh6/2kjWBm8S8 sIYeLMk0LSJRj4nscQ18xlQdOqhAE0lLhutAMcyKmiAPeDldrJUavO4mB8u/BOyf/z7U f5QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790242115; x=1790846915; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=HjF34qZSn4LgZAXLth1PNUz23kb06ygCvrmIzbiAeOs=; b=eCXHC1dZ04Z4Q0Dz7FGvNimcbXl/oE1lWhEzf1xrdkrBaqqGZ6gag1SQle4NIyHF4W LMjpln5MP/QLPzqfGWNx7xi52GVqEObsP9QYgfkGsxExChAW9DBQV+hBcFWyAXi+NZky Ye4J4g11bLbb6oUX7YCyRetdZUhMnbWuhMvuNpSPFhKvET6yALuNgFE4SjPAa0wvI/eN XHRszp4ZxamgCuWJ9t8fpymYWMkkscPRBZphaRQh4quef5qQSZzKEmKxEBbqUmjDsW3n DXbBW7evigBP5qWTfU7zd34X87oJ2NVyDv7gOcJxoBI7B5LEuDjWa4Yb2TedDFJ1xr5H IozA== X-Gm-Message-State: AFuF++mpXjAgGEVPv3szZWGTsq+TC86mNJK5S/ZX7DMviHDm0Gl3e8f1 JhV0s1S/fOmw90u/SZpOZtQD/7tYBuOJoCaPGfm0yiyqjJYnLq/1Tvpt X-Gm-Gg: AYBFou2OFn9fOiRs4yj9EG2iaBzis9ZIBqhBAgDwePGjB5UYutfTHCiGS2vi9vN9ZZ3 yQTorY4yw61JCTvUjKnfEIbJb9WjpIjikCXKMRB3QQrBD1mmjy3b8CsEzNwgKADdYaUFdVaS4sz WuLn4sRIzJNKdDd7d/lRg3gnLHZBAyGlgZ8E52USjMEIzEErdtStV+fgn9Pct8urPSxkiH5ypkg tetfkrpA+FjL/GT/3UDYQg8CwVVaC12uQtI3o0+wKBODEiOThXy9YJRw2ChJ/8L5vitgt9BOe4I M/QC/oi1Z4w4U2/bPoPVwfKJzHpZteQ+FmNbkMhArJdlaDuRZl6jidAFNnfbWf1hXhhWgwoMTn6 6hE5wgHxg/ma/7JX6sNn9ei3o2TNg64JSmc3yYtrZbHalvY90I5+PT9mqfFtuGqooboVP/SI0sg pFvo5x7LCRKnau/lFtQXPhEhDhoOl/TAgooR+CWLjqs7zjmN0L84IZWxOnyp0YZ0+BVPsG83lDs ANgsRk/ZW/NUHj1Q/5eWji68kPG3IMB97R8gHreuALDvz8HYiZwa+dzjA== X-Received: by 2002:a05:600c:4e86:b0:49c:ffe3:2b3f with SMTP id 5b1f17b1804b1-49fe66c8e13mr28851305e9.3.1790242114887; Thu, 24 Sep 2026 02:28:34 -0700 (PDT) Received: from bdtpg (ec2-15-237-197-144.eu-west-3.compute.amazonaws.com. [15.237.197.144]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-488684862a3sm12193264f8f.7.2026.09.24.02.28.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Sep 2026 02:28:34 -0700 (PDT) Date: Thu, 24 Sep 2026 09:28:33 +0000 From: Bertrand Drouvot To: Xuneng Zhou Cc: PostgreSQL-development , Andres Freund , Amit Kapila , "Zhijie Hou (Fujitsu)" , shveta malik Subject: Re: Logical slot creation/synchronization on a standby may deadlock with recovery conflict resolution Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Thu, Sep 24, 2026 at 03:49:35PM +0800, Xuneng Zhou wrote: > Hi hackers, > > I don't see a clear solution to this potential issue, because the interface > is a function, which means that the held snapshots cannot be popped cleanly > since they belong to the surrounding executor. Thanks for the report and reproducers! Thinking out loud, I wonder if we could add a transient PGPROC state while a backend depends on recovery replay. After deadlock_timeout, ResolveRecoveryConflictWithVirtualXIDs() could check whether a VXID in its waitlist has that state set and, if so, use the existing recovery conflict cancellation path. Does that make sense to you and others? If so, I can have a look at preparing a patch. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com