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 1wANOL-002K2I-1Z for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Apr 2026 07:32:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wANOJ-005qo5-2y for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Apr 2026 07:32:00 +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 1wANOJ-005qnw-1y for pgsql-hackers@lists.postgresql.org; Wed, 08 Apr 2026 07:32:00 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wANOH-00000001G8Q-3sxC for pgsql-hackers@lists.postgresql.org; Wed, 08 Apr 2026 07:31:59 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-488ad135063so26962675e9.0 for ; Wed, 08 Apr 2026 00:31:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1775633516; x=1776238316; darn=lists.postgresql.org; h=message-id:date:content-transfer-encoding:mime-version:comments :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vsIDbTrAhGQHBqFvfoFRaSty6QE4mZd03SIrKluUQ04=; b=JosKwXEK/60FlpC/GbaDazGTtot9l5Pv2SPs4UjlECSWdoQ6s9rI1GyV1qbSingCSV Ac+1GOzDlqmceWKOx7/ToVi/Bvttj+h2Ujh17/cW9HCsdfWkOAU+dHs7RDxJagZxkg3F yx1OeYaa6jmwDe9iRDwBfS82N9v5y42BZ2L4W+1c8Uee3dMTPyeGdM+06Vf1E96eX7DI eaeK7HvRv13TOngcXCREw80GlyePqqXKay6xllmwDSbQgc76J2be8qd9YcBWcN4+9onj Ppjyy6HfPABPZMvqm+QreJMAbEZfCkU58dWtZ06P2HHgf2Wp3LDeEKQlDD6HhWOUmFgo OVFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775633516; x=1776238316; h=message-id:date:content-transfer-encoding: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=vsIDbTrAhGQHBqFvfoFRaSty6QE4mZd03SIrKluUQ04=; b=RkyI/ctGXBYSFpnXno+kMPbyGHRqJGUq38FKgHX/Rt5bz701a9WtZUHWSc6UBrARWO nD/sUub1/EdV5ARvr+Dd3sP+dHOGhjQMcyREpwZDcsq0h3fLatl2Iwk86A6R/fkQjmSv ixQxbfdDrfOJnWAtqJhuKljJyxrRblMhiHUxaKrCnUVjF3MVY9L9SYKKFn8lmkk0KkuB nqfZSLrhUvMXTzpFfG23tQxnhOIy05ptMguEQ+z9Oucl4Qo6OuiKmWkr3TIC/MuNV1mx S9fc8Kr8cJHAofiAKoDGx43de2aEGhZcDsuCKC3uQju+6W6/9TCKQJGMSzfYpDrVRQ/r ymkw== X-Forwarded-Encrypted: i=1; AJvYcCWxAOXghQzk0OBPQZi530TR0PZ/6ZuaW/oJ2xfoNju31vcvd+0zmswHeMr/o8jutpLVgIKV7s6Smdo9d8g+@lists.postgresql.org X-Gm-Message-State: AOJu0YxRV4lBea6OUq1vI+oKUzvJnIQIJ/qMn45GTB2qjzfuTTnCYWdQ zl6RTa5PGdqP+lGKsHkw+IQVAJLhQ21yp9FbVsXrgh3bu23gSbE3FMKQVes+9A87+Yk= X-Gm-Gg: AeBDieuXO8aNNg/pi1YKYGo8WdSYBn7EXhngyNyg4NwfC+ronJQKjg6fCLQuJRNuexm N1Acviu6skWRrMUDaVeI118JPChXNbUniNgxwzydAtesZZ3TQB4AvRSvqrWU3t0gy8FqnL0ADm2 9ozwP5hFyizNrAdEmGd/oCg68+TV47IJ9i/hcUzg2cTaVONfPt8CrDDNvMm4RkCv/skRxbZQlD+ C5UzL38GXaJiLjTThfYMJh8XX42Yhjkf+v/C3j/GrqMZ6hVyJ9EUJclVW0kwbQmnSupGP05jRdH GKatLB9tY1+bYngtqkMCTAOEN4kdp90VBhyDVKlxVUC9q2Ee6ViPTrh4krfrJkGhgKeNNy1CZaL oKudIE26Xj7fPoWldwbCaUADCTqeNKTPzjpvzgqQBlMa6yC6ctesIXEZ7ocB2aKNMJ0dJ7bTEC7 rpyi7ByYN9yRAhWgvFtQMrNtDMC7RYJF5Ds6n3 X-Received: by 2002:a05:600d:1b:b0:488:b8bc:6a32 with SMTP id 5b1f17b1804b1-488b8bc6cc9mr86243705e9.23.1775633516347; Wed, 08 Apr 2026 00:31:56 -0700 (PDT) Received: from localhost (109-81-168-142.rct.o2.cz. [109.81.168.142]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48895e19c10sm408292905e9.8.2026.04.08.00.31.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Apr 2026 00:31:56 -0700 (PDT) From: Antonin Houska To: Robert Treat cc: Alvaro Herrera , Mihail Nikalayeu , Srinath Reddy Sadipiralla , Amit Kapila , Matthias van de Meent , Pg Hackers Subject: Re: Adding REPACK [concurrently] In-reply-to: References: <202604062213.cgo352cdsgsm@alvherre.pgsql> Comments: In-reply-to Robert Treat message dated "Tue, 07 Apr 2026 15:43:50 -0400." X-Mailer: MH-E 8.6+git; nmh 1.8; GNU Emacs 28.3 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 08 Apr 2026 09:31:55 +0200 Message-ID: <6607.1775633515@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Treat wrote: > On Mon, Apr 6, 2026 at 6:22=E2=80=AFPM Alvaro Herrera wrote: > > On 2026-Apr-06, Mihail Nikalayeu wrote: > > > > > Anyway, here's the three missing parts. I have not yet edited the > > deadlock-checker one to protect autovacuum from processing tables under > > repack. > > >=20 > I have this lingering bit of paranoia that users could end up in a > situation with a large / long running repack that goes past failsafe > age which prevents the simpler fix of failsafe autovacuum from > running. While the repack finishing would resolve this issue, we can't > know ahead of time that the repack would finish in time, and > statistically speaking, failsafe autovacuum should generally run much > quicker than any repack could. I'm not sure if that means we should > let failsafe vacuum cancel repacks (that seems a bit extreme), but > maybe we want to help $operator to think about this decision, except > if we don't allow autovacuum to wait and we don't allow it to respawn, > I wonder if the end user will ever realize they are in this position. > Granted, there doesn't seem like a clean fix for this... If REPACK is not going to finish in time, I think it makes little difference whether VACUUM is allowed to wait or not: even if it waits, it will start j= ust too late. One reason to avoid waiting might be to allow autovacuum to work = on other tables in between. I agree that the DBA should have some guidance to asses whether REPACK or (failsafe) VACUUM is the appropriate action. While failsafe VACUUM is clear= ly a means to avoid XID wraparound, I tend to consider REPACK primarily a comm= and to remove table bloat. Or is there a situation where REPACK is better even = to avoid the wraparound? Technically, the deadlock can be avoided by not running DDLs on the table while REPACK is running. I'm just thinking if, by mentioning this in the REPACK documentation, we'd admit that the REPACK (CONCURRENTLY) feature is actually incomplete. On the other hand, if we don't mention the risk of deadlock, it's a similar situation to not mentioning it for commands like ALTER TABLE: if ALTER TABLE performs table rewrite, deadlock can also result in a significant amount of wasted resources. (Of course, it's not the same = if the purpose of REPACK is considered substitute for failsafe VACUUM, but I'm not sure about that.) --=20 Antonin Houska Web: https://www.cybertec-postgresql.com