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 1w7WdC-005PKz-3D for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Mar 2026 10:47:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w7WdB-009d0u-1b for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Mar 2026 10:47:33 +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 1w7WdB-009d0m-0i for pgsql-hackers@lists.postgresql.org; Tue, 31 Mar 2026 10:47:33 +0000 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w7Wd9-000000029ub-0Wpf for pgsql-hackers@lists.postgresql.org; Tue, 31 Mar 2026 10:47:33 +0000 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-38bf1561215so36487851fa.2 for ; Tue, 31 Mar 2026 03:47:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774954050; cv=none; d=google.com; s=arc-20240605; b=lEA31uyRHb6LYc98pv2Yf+DhFcEpj7VkBt4DV1tXSL5qD7ZIhVvW1ANQtXMKXN6Vjy roWJyAR2MCUNTg3CbQ44OwPG+RrlSqNBsYwJq5SPd//ptMNF+qqnZl2qHjgMdifSWu84 LLOQw213vsxp0CWhS/j4VDhAT+5uJbVBCeAC0AjIsm3OYFQHXc9cCDFIPfHGRBWzmAhm lp37rF1b0OaOrInVbOnBtVxsTuIQjFoTrC/UXpKKeVUE3WW7tPE3XF8XcSKXC0vl8bhx 0b+3JoYi+q6HrheselkcaOwcxBu4UVaPaG+708uKB7zL+9/aPtSGPLg5znCY2QFvkVO4 CzqA== 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=VcpU3ovCtDEfvhlGU+k3jDsPb6ce+ozt0JmVpyIYg/w=; fh=dX6pPDfscyvW1kJc+B7uJBlRe8emg46j6tMdChDDIJY=; b=LBiZe4UVwNz5fZM5f9IM7t/kOTLkohOgttS5uBBk4JyqXzfod1vOLXiNi5XCEsebvN LCzWfi1zycCwEwOdaUgO7Ho/NX6A6Wrb3JMmEHAg0gE39oKAhNvhPZabe6cFZdShLmQ9 FHyqL4twRfDX/SvAb37jy8Wtl/6S4gClNC9/wnCCSq42w8LEarMZJRL8pUjU3J8ARa8y ldBsdnHLKFe180Vp9ngt0UQO3CZ5GL4BF3rETCmBbSze4xqSg2x2uRByhIJiejznuRYP k22tE5vQp6MRnpzKf2KgVmu59SnDZ85hJhQ/DbDYahcxI/8wJt6sGSViEE6fWzGShq1z lVog==; 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=1774954050; x=1775558850; 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=VcpU3ovCtDEfvhlGU+k3jDsPb6ce+ozt0JmVpyIYg/w=; b=cd4wT/JDoFOuAZbrDYrI1aDqbnU/gCmlomeW+7SRd3xK06YabOYwsbxczkSWJQTFG2 3NqJ09gJBBO79zEStO/y/IzRU6UCgdfYcMEXFJUk5ULMN6c+RTnL2O2nSy0gAgA2a9gD IOncbor3McSYK7XBJFiLhw+MnWcgD2NkUM23Bj4svrZfO/dfBh6B1S7MiT+C7uP32T2y wMlY3E8Sc2PYTW4LXSfAZK1pi9/VtkXEFaOC/PVv7b/ovhSMhxsLYYkyz4Em2menNyj+ 4Lw6jlEcB8tRKICW1dHBcwnp0zaeoJ1MjXHJGcE2lOWLigDuOOwD7+Lr/vv5xdVoj2bH 9HLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774954050; x=1775558850; 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=VcpU3ovCtDEfvhlGU+k3jDsPb6ce+ozt0JmVpyIYg/w=; b=USEaE2VOzK92+C96s1f4/4w28yRumh4cC2C+pkLStI2AEgjEpL4l/tOuSOS+PL97nM GbyuKFWI5oZNmfQ1XhpzApoeMan1PGiQq27bpJyKtJ7c00K/FaxuxiXXMX9MW7amPBEZ 76pqLnkCprVarMqRvjBmsKIDwnB8Nnu3DFE3IObjqq1FCDBAey05gRJhbqr5IlzL8sqA pOv/XM5p6UyF/025EMnLezzHM1HE4kG1mniOaGNNkjSCo4UB4wjZ2yF0dWib407Losm6 3epFpbTnUnraBuVS91kn36mXFS8E9ELcF6AXwzv7kR+fgmrVC4Z6kKoBYqsMHDzq7gAO pJdw== X-Forwarded-Encrypted: i=1; AJvYcCX7oziNgHAITVrrWfECFnCHn1bhHGoRzbmYsgyVexB+H9JQs22FBZpvH2cgivGhXYbd2/Vgy+vGzRLIfMfB@lists.postgresql.org X-Gm-Message-State: AOJu0Yz1xnd41EXzsLA4V2rABvZMbaAQMpf7LFGkJwiK8rHLhwrlARxX 3+sKTdAcumx8oWV+ZSYXpIZ0KepSfOS06wyT4dTJgMOsvokIDyDpHVquhuSbbv3lKIbrdnq0uoK SfCCFWe600rC5lqtZPjizp62DxZDiHGk= X-Gm-Gg: ATEYQzypjtV88Ewccu064TS36UrYH7AFJqoD6+sfo92dhwR5zr8wT1dfoW38/DLCttS DiRj8uiM0UAVg8TxJuC2f41Pw12o8JpWLGEVmdzXR+XuNVLhw4dtiIFKBS9zxVqCFf2L9k79sq9 uV8DxSX6DH/8/QhJaQ4jIaumKwqNCPNs9bYxtbMgz2tvX8TyghTLy/iBdoVPfJ/otiwhaeEHCII Ir5YmeEkLD8lSkjzdf/pnl4RoD6EzfwASMxBA77Yjcy5YOcGLyyT1Js3Js+CHSO5qHAlb+GKvnH AREQYN96Zwnd5kAunkBCVsx1PU8VPHRTd8Y5UfqhhXPDenFDfZc= X-Received: by 2002:a05:651c:b22:b0:38c:63df:82a2 with SMTP id 38308e7fff4ca-38c74092afcmr50839741fa.27.1774954049717; Tue, 31 Mar 2026 03:47:29 -0700 (PDT) MIME-Version: 1.0 References: <90700.1774627975@localhost> <202603271635.owyhm7btgoic@alvherre.pgsql> In-Reply-To: <202603271635.owyhm7btgoic@alvherre.pgsql> From: Amit Kapila Date: Tue, 31 Mar 2026 16:17:18 +0530 X-Gm-Features: AQROBzCIC0KXUtw4dZ-PNx-nINC_QtMcQ3kVzaXevQita9F1Jp4kPoD0c2HsFXU Message-ID: Subject: Re: Adding REPACK [concurrently] To: Alvaro Herrera Cc: Antonin Houska , 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 Fri, Mar 27, 2026 at 10:31=E2=80=AFPM Alvaro Herrera wrote: > > Lastly, 0008 is "Teach snapshot builder to skip transactions running > REPACK (CONCURRENTLY)" which I see as the least mature of the pack. I > would really like to be able to squash it with 0003, but I'm not yet > trusting it enough. > Few comments/questions by looking 0008 alone: 1. + TransactionId *xids_repack =3D NULL; + bool logical_decoding_enabled =3D IsLogicalDecodingEnabled(); Assert(!RecoveryInProgress()); ... ... /* * Allocating space for maxProcs xids is usually overkill; numProcs would * be sufficient. But it seems better to do the malloc while not holding @@ -2663,11 +2672,14 @@ GetRunningTransactionData(void) */ if (CurrentRunningXacts->xids =3D=3D NULL) { + /* FIXME probably fails if logical decoding is enable on-the-fly */ + int nrepack =3D logical_decoding_enabled ? MAX_REPACK_XIDS : 0; This FIXME is important to fix for this patch, otherwise, we can't rely on transactions remembered as repack_concurrently. 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. 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. BTW, are we intending to commit this patch series for PG19? --=20 With Regards, Amit Kapila.