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 1wCdy3-002BcW-1v for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Apr 2026 13:38:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wCdy0-00C4QW-2y for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Apr 2026 13:38:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wCdy0-00C4QH-1A for pgsql-hackers@lists.postgresql.org; Tue, 14 Apr 2026 13:38:13 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wCdxy-00000000ylq-0UWC for pgsql-hackers@lists.postgresql.org; Tue, 14 Apr 2026 13:38:12 +0000 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-488b00ed86fso58214445e9.3 for ; Tue, 14 Apr 2026 06:38:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1776173889; x=1776778689; darn=lists.postgresql.org; h=message-id:date:mime-version:comments:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=Ri10LnJvovm4QUOSHC865YQdrcl4KSR5LsejdGde9CY=; b=PWCDTBJGSlSiCog9XpJzR0x49iT6gKVsbt1uhL2Nfg+ph2KGsg4GQ/Ws+cVX2tu53S W0I4p1dX8Eeh6r2uYUutJ1K3oBXjEuNaND6+ecbvjLrIQeiiyPXEqfsdG+khuQ5XarSy 6SZ1jUiKFTPwECBrU522Q2mcZSmJOyWXPCd7a8NWcrVPCilUqd52ieNqitUGkD0B6C5Q IzbRzcncqcJj7dw446OADSmT0uGhonfSSlpMZOqmKjnikkBuUrp5zq7K9sOme+jVOQuo Cmk0QFaqdSztHegIXwU8RCWKPyRORpcl4H1nEqw5eCx7/NzVbwLQfgMLpluRcajibJPV OLqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776173889; x=1776778689; h=message-id:date:mime-version:comments:references:in-reply-to :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=Ri10LnJvovm4QUOSHC865YQdrcl4KSR5LsejdGde9CY=; b=ejBxXSgFa1/1+13tkRdWavvjmCqVZnOsU8zp0eC6gfwjZ8R3GSavtB9eKL1K9scaZo +Cmq9ln2tXtpKREunJEV1bSnfyo8adCKNAlNVcsQCSQ6y/qAPwBSLru+634Lvm19YMeo zaKd4L6YwCNPG/B04wwMHE9+C+O8imGZEwe4iaavLGk1RT50VBjdVgb9oH2LtcRCEYTh dZ5LOuh4NeOHFCHGn+XkJapz43Kpo+Sp/8Gt1kBMdS/Vw4Gg/njYbir4qxKN9UvEW5sh 9SIlw7YBfxXU4OdFjxZUXu6WT+F/2jO/UrGpDTzO6qigXHQByqP0HqUBYybJDE7G1DGc R8Cw== X-Forwarded-Encrypted: i=1; AFNElJ8oqBPW+3NsUS5xit0mlOwKvQS6m7DbDlk6RlbeQUtHaln78c4hqMgfCPCLr1bCx+JwfkloGZSEJQqeMV82@lists.postgresql.org X-Gm-Message-State: AOJu0Yx9v2tKpLqgT0Rm5dLyOq6pwoaxokY5y94r02GLzj606OVWjlH/ HnMSB14WCCDqBWANiYhGScpTxub3Y+HDfcPdWBS0tsJYSP6OVZDgTsuFbuUr0dZyQf8= X-Gm-Gg: AeBDietF3EOH37bPY98Yeri95e89FzYpqxJbw1dQ/T0Te+uig76q8eFhfYiqsowulyr wAgwtebavJEhGXIdRDD46Fsr4iZMmBEj2bFZGLoxLiFHmwug0z0TLXnQoO+K9j3/zXWz14FJ12M ebD/Vsv3wTcPZVU6Xh49tYvEptCMAjR70nGXacQ1xLnBvuHy99SqkxwicTJl8y3Yx7O73Gy+CBz uqxcXGfPyD2IFp700MfNJoyArtF3GIZgt0cBBbur8y2c13GMwXqYXq4Kqxt2li3DnEHlUJvde7+ CKtm21oTitpwKjMOkvehTZlwkwJALuaPXPszlRfWRjA9E8CG/yFKr32fNinb6ogspukBcVQz25b UXQIx1UGo665WMRVb38780ixs2SO1fLE/ZbC9XLk9Ew/sqoECFlYA4eEB4hCuW5vFyvT1hTanIG eGzmp5tZESy6I8bwpI8ROA87PYuI64Sgprmj2Nh1sf/FpnmVw= X-Received: by 2002:a05:600c:5299:b0:487:1fb4:7e1 with SMTP id 5b1f17b1804b1-488d6875f3emr233067755e9.22.1776173888942; Tue, 14 Apr 2026 06:38:08 -0700 (PDT) Received: from localhost (109-81-168-142.rct.o2.cz. [109.81.168.142]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488d5d9dd86sm188256335e9.4.2026.04.14.06.37.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2026 06:38:07 -0700 (PDT) From: Antonin Houska To: Andres Freund cc: Mihail Nikalayeu , Amit Kapila , Alvaro Herrera , Srinath Reddy Sadipiralla , Matthias van de Meent , Pg Hackers , Robert Treat Subject: Re: Adding REPACK [concurrently] In-reply-to: References: <202604062213.cgo352cdsgsm@alvherre.pgsql> <4n4q3preb3lgyhpzstebhux7b2aojhsw7gik4ivaznyggiezrs@lrznutssxlh2> <9539.1775724194@localhost> Comments: In-reply-to Andres Freund message dated "Sun, 12 Apr 2026 10:05:34 -0400." X-Mailer: MH-E 8.6+git; nmh 1.8; GNU Emacs 28.3 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Date: Tue, 14 Apr 2026 15:37:56 +0200 Message-ID: <112208.1776173876@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --=-=-= Content-Type: text/plain Andres Freund wrote: > On 2026-04-12 15:31:20 +0200, Mihail Nikalayeu wrote: > > Instead of cancelling the backend entered the deadlock detector - it > > cancel some another (nearest hard edge) until it is possible to get the > > lock (either by > > reordering or directly). > > I don't think that's as good. The problem is that that way you're only > detecting the deadlocks once they have materialized (i.e. once repack actually > does the lock upgrade), rather than cancelling when we know that the problem > starts. This is my hack that tries to do that. -- Antonin Houska Web: https://www.cybertec-postgresql.com --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Teach-REPACK-to-upgrade-its-lock-safely.patch