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 1wBH29-000tu4-2X for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Apr 2026 18:56:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wBH28-00EGLD-0U for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Apr 2026 18:56:49 +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 1wBH27-00EGL5-2e for pgsql-hackers@lists.postgresql.org; Fri, 10 Apr 2026 18:56:48 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wBH26-00000000P3S-25D5 for pgsql-hackers@lists.postgresql.org; Fri, 10 Apr 2026 18:56:48 +0000 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-43cfac48bc7so1639856f8f.0 for ; Fri, 10 Apr 2026 11:56:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1775847404; x=1776452204; 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=DVGoIPpzdtlTa4nVg8YA8bWJdtD6+wiMKNfLPeP+/Jo=; b=CI1Z5kjOM1VOAIEESt3vrwlU7L29DIGdlMUyPspPr1MtBndrOIP4Sq7VUfqlwNTshC HZ+JvmKqKD/fgYzp6gTkF9pFRWmDFHUUUIqK08JeaAOmjwPurcndJd9pZNlbZHTozxhQ r85fT3MTZHsz4RF2yEtCBA1hDnaHgNgHIHORnvIqBcoQlIFFjvkYXeLU1L65DxQE3tNc W+dOCmcx+TJB11KnlGcyArMma00VntqebzcteKNwTe5r8aoUmXyFIZZ50qHUtfhfKAF7 bRXCFksVzoCLaOkq2hnOhnTJGQdz5XEqo608A1rYUgte6DiSKqjG8dslvJXffETvhHC8 2Oqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775847404; x=1776452204; 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=DVGoIPpzdtlTa4nVg8YA8bWJdtD6+wiMKNfLPeP+/Jo=; b=EXZ6Q5jAVdmdF7HiVRR7kP7AZcqsQA4w2rBx7us3YA38UwGdyMaFHzIRhtqyOs/Hf5 yHeJWN7t/kpbyiDyJAk5bXKqMRHftNblV+5eimJaGCy8iYuspqP8WorteVpQxQhUm9oU CC/KD54rC07J3uR7eNIkHI6E37RUK1dPAy0Jt3vw9h8Qklbsrdf9+cEk8CLYrBOjcWX+ wX2/eGFTYb2YXgiYwseEMbEfX5uIZsQUkgfyA4JpM9+Chhi3ixr28QIpVz7bhfg03cxR lfomCj9A1mWhjg+axycI7VUhdc9EtXHsFj4OSIuPQm0IE2ndSHO2saWA8ihylPfi6gXr 1cjA== X-Forwarded-Encrypted: i=1; AJvYcCXY4+SNTYRVZb7MLtitFmvULf+VkFwZj0jKcCWXEtB63vqNVbTc1yjalZHi+MhdFrDNPlndSvwDrGBaVbJE@lists.postgresql.org X-Gm-Message-State: AOJu0YzWX5cwezk0la/PjtryqvJFvYlT3chD8YQZbtLqXPv87Zq3usqI Wp4YRQP5XdkWTn7yyFocQOaZsQ4HnF2y2szybo5mggJFw9IzrxtpMSNkD1wQmsd4hg8= X-Gm-Gg: AeBDieteyPT2sTBveo/DKzAJ6dfeBm76MqLEt0lfA/J4wz1Py9XqridJb3sEjYPuGPt 8yQvtMsnC2gzwVuX5epnLg5Espk94V2FMPpo/K/ZQT16DW8ZlEF+xL0nvtikWnZ7kfUsgoSaJT1 3PuDFv6xDnZfHXjGFBxURFrhlcnqacyvH1l+qujC0uTlth0JGSEWPiToAKmODhz1orat0arrUmj Ro25l5aD3C35+bOEkqKnr9N/XR8GfAswrUn4EZ2mOKyducaEZpX1lpNf2NmeZIxf9R6LtHYoUAi ZLJYXeaOV4NFWm69XXEWcCM5cdMaNjbfRcAHYsVIVpnbmsaHAcdTM9vZ88wEdaPtq26lHPiSeW9 MMS3T8Xx8XN71EIXOQ7FIl09b/9ypRvkA4+gvItmCdY5qS9wM2ldwaRDAq5a7GBa0jDpYxkmUVl dm06bFugnQ7a0U3oBnLVSyBiDGtybHLa4+ealX X-Received: by 2002:a05:6000:4284:b0:439:d242:e8fe with SMTP id ffacd0b85a97d-43d64289c7emr6839384f8f.11.1775847403768; Fri, 10 Apr 2026 11:56:43 -0700 (PDT) Received: from localhost (109-81-168-142.rct.o2.cz. [109.81.168.142]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43d63dec295sm9299039f8f.14.2026.04.10.11.56.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Apr 2026 11:56:43 -0700 (PDT) From: Antonin Houska To: Robert Treat cc: Andres Freund , Amit Kapila , Mihail Nikalayeu , Alvaro Herrera , Srinath Reddy Sadipiralla , Matthias van de Meent , Pg Hackers Subject: Re: Adding REPACK [concurrently] In-reply-to: References: <202604062213.cgo352cdsgsm@alvherre.pgsql> <4n4q3preb3lgyhpzstebhux7b2aojhsw7gik4ivaznyggiezrs@lrznutssxlh2> <9539.1775724194@localhost> Comments: In-reply-to Robert Treat message dated "Fri, 10 Apr 2026 12:14:59 -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: Fri, 10 Apr 2026 20:56:42 +0200 Message-ID: <138051.1775847402@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Treat wrote: > On Thu, Apr 9, 2026 at 10:20=E2=80=AFAM Andres Freund wrote: > > On 2026-04-09 10:43:14 +0200, Antonin Houska wrote: > > > Anti-wraparound (failsafe) VACUUM is a bit different case [1] (i.e. i= t should > > > possibly have higher priority than REPACK), but I think this prioriti= zation > > > should be implemented in other way than just letting it get in the wa= y 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. > > >=20 > 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 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, 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. What about just teaching the anti-wraparound VACUUM to print out a WARNING = if it could not lock the table in "reasonable" time? The DBA would then have to consider if the blocking command should be cancelled, whether it's REPACK or something else. --=20 Antonin Houska Web: https://www.cybertec-postgresql.com