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 1w7ua5-0001Ij-1E for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Apr 2026 12:21:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w7ua4-00HSSL-0A for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Apr 2026 12:21:56 +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 1w7ua3-00HSSD-2V for pgsql-hackers@lists.postgresql.org; Wed, 01 Apr 2026 12:21:56 +0000 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w7ua2-000000000WF-25my for pgsql-hackers@lists.postgresql.org; Wed, 01 Apr 2026 12:21:55 +0000 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-5a0ff30b240so7930620e87.0 for ; Wed, 01 Apr 2026 05:21:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775046113; cv=none; d=google.com; s=arc-20240605; b=AqjJhDfGJ4zOqER1kF/0MUiv5Ph0HoSdGTiNxbbm2mnzhKuP2IK/JpqBtftTgL57nl h7LwmQPe2WLfowjL0olM1q5ITz0Mk5DIop+mM4LYfmBPDQvbIkwnlpDLJTJMvBFdq5j3 lPiI32xqLmuJKPOhI6t0txBDwW6cFa+lGEtv3Bl/NsOrMALOYgNfs2851+Hh/ek/SVly UobqaWmVoXTh6vKh3/IUXZ8iPDEgjWouWEmU/GmJsyLzKhCAny65y/EOFoGlPINP2oOy S+Wng8bmhh9CyuLgge9Ryfbxk4tP8JAeKaJSVp+e2ExqdYSORm4Td0SxwD7pjvP4Jsj1 /TrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=6+vMPozBkzCgK3BRr9cnSW8yLE6QeOu4ZRMkRTEHy1g=; fh=jgm4iKOQXcUO1Ot0NucdweoMzeaWLaA85aJ6bZEtdgQ=; b=W/lU9H5aauqtt5hahTjCDybvqZVHzpdZnHOuL9U2y5kLtOgU7mT55czTJXPccdVl/T hyKTu/sa+fHF7tr+4ha1N6nFdpLYq6hr9ymbWRZWib/BNl89oWBtRA0gFz1OGN/uYjKv 70pg9msQkFjKUrI8QoC4KRWyOh2UjxAgIMOPc/aRUhw+Zo3HihpW3o7gCrRG7dw4TdZf HcLV7uM1rDh87PjjKTKgqVR52TVgAxXHjVVCay26OJzPRCJiTWq+Iz8lo2HWOVhQaqXE IGkkR/kgmGaCwdrpIukZMEANLGUvkpDzNzdWctA7rufixKukRWGDV1gbFpSSfkHKMG8c kJNA==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775046113; x=1775650913; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=6+vMPozBkzCgK3BRr9cnSW8yLE6QeOu4ZRMkRTEHy1g=; b=Yn5mzAGEFO1kXAFMCi/2PCCpIgP03FWZeD4m2/2sv4xXjakClXHYyNCKoBw8TWaolg jJOrIOuNWtXkmZzw9sfrvRniZTkfz4qFrgDs8objEYNV2Mjkwb5OC3nxnYBs0Yk01/nE GbgVBgvk44waEdwXu9woxlWKJntGOl/I479sDffIw2CbJPuK7FGy7/+yt+n6iVOrqKIA BaGBbQW50+qNyEMicKz+FjnqjlIfCrknF8op057rIwRFuXrPnEfNJfI9qJrPBpJhf12m GKDZ7cpq9U5660Emvu2Mao3DK0NFEl45q3RbdEyX9/RoAU0SzJWqC7DMKkZwcbZBS2Id QTzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775046113; x=1775650913; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=6+vMPozBkzCgK3BRr9cnSW8yLE6QeOu4ZRMkRTEHy1g=; b=MBUEeifSYza0abjaRoW11zRd+psZZRGpmCl098v/5Zil8nTRQD8Hd4Q0VMgOS9Dj0K Zzhej555voK7A57zfVv8cXoo95bn+9sBBzyYilwTuqpJrhMqfHx7yiuF90UTRTxvikVo f4CGGv45IqOhAgW2xMFEXjKHYNVY/KKM3p5McIv+S5JsOynetRIhYOjUDMNznvLHkjXY r1ii2JLYSypssxC9LcB3F6TNL7ZD5B9XEKdAZvmSbOq2XZ/r0k5m4noEbIwZ4NP89sFG BB2fvhWvpyEnns/Wutd3SCCPNip4prwqNsf0azMJr7RjskzpXYoHcWhICKMhW2u0tJ8C yjJg== X-Forwarded-Encrypted: i=1; AJvYcCXDds6bVQAWITR4kss6IfNkQSMEbuVXxyxUHMf18EE6A6e0kh2hWUTOicnTJTdz5Vl8ADiMn2C5kWI4EG1i@lists.postgresql.org X-Gm-Message-State: AOJu0YyXhGccs5Z51Sm8zHqizTYdJnAuvsyqIKIiauWh1Ct6j/qFy5wP Rss59O0YjvwrIA2atTgAZxbeW+cM6dhEK9eeYARST3tr9DtRnPAQIqp6K/aLlEpGTdLz1+VcCRp IJ5Uyj/oNKnFIo8okPlMfYvTq0cCHCf4= X-Gm-Gg: ATEYQzwVPrnBuZApjhZhnWzuFerCpElq3JyJywXv+K0eG3/aJ/hg9bUL/f5UDQs2z33 fD8XqHa8DjEe8KlLPgbbFUjtbSCqftToaan7H9NVfsKG0UwZyJ6gt0E2OurZCDFuKw1DcytbntL ZNefOz4t/OznXCbJDMSGBlNMGw42Mtzr1nFfrkXtaaPhGzngvB44mvI08g2ge4N+sogMJrBfp85 yqUE9Yj5zykfX274wKSB3c4G3zi+J/Zn0ro6MF3lzEK6D4Ohg9q55uL0t30v8KpdxtOX256Treg uDVds+7upZCHhAI/vhjPZ4I755WPDlUsu2B7 X-Received: by 2002:a05:6512:1282:b0:5a1:2e83:a7f1 with SMTP id 2adb3069b0e04-5a2c1f2091fmr1436817e87.23.1775046112860; Wed, 01 Apr 2026 05:21:52 -0700 (PDT) MIME-Version: 1.0 References: <202604011050.7ya3k4ccd3hg@alvherre.pgsql> In-Reply-To: <202604011050.7ya3k4ccd3hg@alvherre.pgsql> From: Amit Kapila Date: Wed, 1 Apr 2026 17:51:40 +0530 X-Gm-Features: AQROBzCIT7LbpGONJefPp3iqtGvJZP_gdsTN4GMjyuKPYNpy8ArM2mOyHIWHyZU Message-ID: Subject: Re: Adding REPACK [concurrently] To: Alvaro Herrera Cc: Srinath Reddy Sadipiralla , Mihail Nikalayeu , Antonin Houska , Matthias van de Meent , Pg Hackers , Robert Treat Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Apr 1, 2026 at 5:08=E2=80=AFPM Alvaro Herrera wrote: > > On 2026-Apr-01, Amit Kapila wrote: > > > What about if the blocking process is an autovacumm that is working to > > prevent XID wraparound? I think we already avoid killing it in such > > cases. > > If we just let REPACK finish, it will also renew the table's XID, so > autovacuum is not needed in that case. I mean, there's no reason to let > autovacuum process the contents of a table that is going to be replaced > completely. > > One potentially problematic case would be that an emergency autovacuum > has been running for a long time and about to finish, and REPACK is > started. But in that case, autovacuum already has ShareUpdateExclusive, > so REPACK wouldn't be able to start at all, which means it won't kill > autovacuum. And in the case where autovacuum is doing emergency > vacuuming, then it won't commit suicide, so it will be able to complete > before repack starts. > > > BTW, one can say that cancelling a long-running report query also > > wastes a lot of effort of the user generating such a report. Why can't > > REPACK wait for such a select to finish instead of cancelling it? > > I don't understand exactly which scenario you're concerned about. Is > there a long-running query which, after spending a lot of time running a > report, tries to upgrade its lock level on the table? Keep in mind that > this check only runs when the affected session runs the deadlock > checker, which means it's been waiting to acquire a lock for > deadlock_timeout seconds. It's not repack that kills the query. > > [ ... reflects ...] Oh, actually what Srinath proposed does exactly > that -- kill other queries. Hmm, yeah, I'm less sure about that > particular bit. > Yes, I was talking about Srinath's proposed solution. Do we need to do anything about it? --=20 With Regards, Amit Kapila.