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 1w7r9r-005lTh-38 for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Apr 2026 08:42:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w7r9q-00GBSy-1C for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Apr 2026 08:42:38 +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 1w7r9q-00GBSp-03 for pgsql-hackers@lists.postgresql.org; Wed, 01 Apr 2026 08:42:38 +0000 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w7r9n-00000002K4h-35Yp for pgsql-hackers@lists.postgresql.org; Wed, 01 Apr 2026 08:42:38 +0000 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-3870778358aso44413091fa.1 for ; Wed, 01 Apr 2026 01:42:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775032955; cv=none; d=google.com; s=arc-20240605; b=bJoBm2KGS6CvMnUzPFbeCmKiPwG6TeI196Nat/eOj8b2yAhZls4YhYu+i1pbm1OkIt kW/vfhA/NdCzZZsppN4jsPgmpZD0DhAlkbQtQQSofLqjDWc8v2HDgduC0yxUI+hkmyQZ iHy96BXt3jR6p7xRSxU9Y2bmw/n4Sa2sRvTXTgTehgm/8yJ8jyiWP3LTsY2GoDVLVuTB 3YkuMVHriQGoyBSuvpLT9dtigGh/EACaqN2wqqXBcy9f//BGgPf1jODhzf/bXTT2bFub 7/h2ND+Sb33OzVTT8qCkRm+vg33R1d1sy0SK2/gdO/wkoxm1anIiUV6vwyreClRz5EE9 Ymmg== 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=7TyjgjN9xtEafEKJfFJh/mT5GK7/C4dG3uTyP3igzWI=; fh=Nte/pJtPRJOcBuTawHtDL+lsrrlQC2IOPRSZX2j0VFo=; b=fScWxPsXJXU6no48tdB9Tr35FYnx1fK2y/LNq7bd0OJ8ggLAQ1AwMlAf9nH721rTKz GNtX9N38gM8DEYwENclV+K5exaIxCJpjEgVleGtlaIPS6QaVAWMI1sVyRByRkGPg/fa3 8GJwunOFrh/OT/NF4GWl1xzFaYqwwZ7jdyj150YSrh9OurHiTeR5GyaKlVshnWZkKLaY JsUEeynfU1JWRpFQstlqsrbmi51wxQJww1vbs+3eYQ8R4iahIyrYKg6f+Ah2fq9EWzuT hW8AkPydYwRcZ8Q/TbxVQ3RW/wD3siRnDWcZLmTsVpb6pf98ZcqK5wepUrajVrGVJbaF DXGA==; 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=1775032955; x=1775637755; 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=7TyjgjN9xtEafEKJfFJh/mT5GK7/C4dG3uTyP3igzWI=; b=BFXqEvw7u2tkCskeF1C0PFILW37aujmfCRj28ZTwAonnxGuIF/JPE867P6ROrhU70M qElee+D9RupjzZ23gCTIze2ota4dODsmxVs9Kl/lRAlXbIX+w8OrQCfnilj81c+3s0R1 uLlZSSYmUpvxZfuublXB+L2dKWqHlnhvR/xnk5ksEXshsYXWturEc2i/VMEKeSrKmb+z hU1oBF+xcIHsfHH7gLRTAxxmHh0zB4bmnf5rYl57khijeYL1WkQMpVqki9yXw5mBYYx+ fzD+zuUwtRjsIsmjy+11sdegB4+EvNJpQsYWGClB/Al3WauxP9M+7AnkgXCE++ieLSci Op6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775032955; x=1775637755; 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=7TyjgjN9xtEafEKJfFJh/mT5GK7/C4dG3uTyP3igzWI=; b=Y9Q24a9kA0WhM9sza/UXTNvW/AAIiX2aST3c06oQCHVqHCMwXrOY67T6vm5gw82kSF 1nKQjEZqth2cp/l2ccv25UlfE6k/JjJzAQPCQ/ctI2u46gUwiRDzIdqG3W3gdnnpIcza d/HCNfS391ymybfb4XFCSfwxDEWk4zpdicruecEcqK0bxqQmhppwweY6gI0tgt0Nx0FO F/H0gr71Qu9Eg0BFQOhtearI8Ls7pD0AI9RUJiFurqciGcoRKNYkWmYv0tImM+jqcamS qD6U1JVmfVkKAKHWN93b9tNtXXhfyhsfogXXpzcex5Jw8znwQo425afyQEwdqq6wNvf1 UOWw== X-Forwarded-Encrypted: i=1; AJvYcCVaSSeb769PKCcUQe4xqHXd7fu/mXGcd2c911c16/1jn4y85XTuRMkHwamaqZb2kVtowj3L6hCEhXvVXKYB@lists.postgresql.org X-Gm-Message-State: AOJu0YyHZGcZOJCsPOtgdLHyKwPvs9iUlRQijk3lRADr0wgpXNOBGFXd tJVVtVkLB3AwUYA2nVlJ89LgJi0NN+HFi4OE4VJ4StEzDB/Zu42EkZ9sLXPVmL/UBL+YkQReDoi AV21K8IQB4YJvE+2DLuUWxfAqTxIetCo= X-Gm-Gg: ATEYQzyQmduYispb88QHXyBwwAd8RYAsEqvnAEf0i1S/yMgGSqeEPleMX0RGjaBY90l t1v/fpRecb2x9EBW9DMFIw8zfGyQgIVH+NyM6Unbl2Ewu3Yg9mw3zNBryB6xfcl+kEto2wQnWAp ExP0TalB/n/NVRWBjYvi7HujRitswYsiWbyoP/0aZDlH4HLlKDBh7xSIBDe0X2e/ggJyxYHKpQE 5IiuDY1RR0Qsv5LkWPNtBmgyM4Oe733XdJWLy6tnKs6YSPc+FFus97Y+2qFCTxQwDJul7d2ggdM 49qK+zEIrvCShzY+8qlowXd2JldsDzP0ghPDbZ6MnEDL0uxI X-Received: by 2002:a2e:bc86:0:b0:38c:6633:e906 with SMTP id 38308e7fff4ca-38cc2f198fcmr9212161fa.4.1775032954370; Wed, 01 Apr 2026 01:42:34 -0700 (PDT) MIME-Version: 1.0 References: <90700.1774627975@localhost> <202603271635.owyhm7btgoic@alvherre.pgsql> <228982.1774967782@localhost> In-Reply-To: <228982.1774967782@localhost> From: Amit Kapila Date: Wed, 1 Apr 2026 14:12:22 +0530 X-Gm-Features: AQROBzCTc8Z34bBMe5hWGCN_c5u_Ap54BQ6H-PZWQaDDs2lGhYB6DUaooTR4iEo Message-ID: Subject: Re: Adding REPACK [concurrently] To: Antonin Houska Cc: Alvaro Herrera , Mihail Nikalayeu , Srinath Reddy Sadipiralla , 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 Tue, Mar 31, 2026 at 8:06=E2=80=AFPM Antonin Houska wro= te: > > Amit Kapila wrote: > > 2. > > * > > + /* > > + * TODO Consider a GUC to reserve certain amount of replication slots = for > > + * REPACK (CONCURRENTLY) and using it here. > > + */ > > +#define MAX_REPACK_XIDS 16 > > + > > > > This sounds a bit scary as reserving replication slots for REPACK > > (CONCURRENTLY) may not be what users expect. But it is not clear why > > replication slots need to be reserved for this. > > The point is that REPACK should not block replication [1]. Thus reserving > slots for non-REPACK users is probably more precise statement. > oh, so shouldn't be a separate patch than this and an important for this functionality to get committed? I don't see why we need to make such a GUC or knob as part of this patch if we need the same. > > IIUC, two reasons why logical decoding can ignore REPACK > > (CONCURRENTLY) are (a) does not perform any catalog changes relevant > > to logical decoding, (b) neither walsenders nor backends performing > > logical decoding needs to care sending the WAL generated by REPACK > > (CONCURRENTLY). Is that understanding correct? If so, we may want to > > clarify why we want to ignore this command's WAL while sending changes > > downstream in the commit message or give some reference of the patch > > where the same is mentioned. This can help reviewing this patch > > independently. > > Correct, but in fact this diff only affects the setup of the logical deco= ding > rather than the decoding itself. On the other hand, if REPACK (CONCURRENT= LY) > starts when the decoding backend's snapshot builder is already in the > SNAPBUILD_FULL_SNAPSHOT state, reorderbuffer.c processes the transaction > normally, and another part of the series (v46-0002) ensures that the tabl= e > rewriting is not decoded: REPACK simply tells heap_insert(), heap_update(= ), > heap_delete() not to put the extra (replication specific) information int= o the > corresponding WAL records. I suppose this is what you mean in (b). > > Regarding (a), yes, the absence of catalog changes in the REPACK's transa= ction > is the reason that even the logical decoding setup does not have to wait = for > the transaction to finish. > Hmm, but we don't do any catalog changes for transactions that have DML say only INSERT but we don't have separate logic like REPACK in snapbuild machinery. Same is probably true for dml operations on an unlogged table which doesn't have WAL to send nor any catalog operations involved but we don't have any special path for that in snapbuild code path. So, why do we need special handling for this operation? --=20 With Regards, Amit Kapila.