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 1wSOfX-0039gP-2v for pgsql-hackers@arkaria.postgresql.org; Thu, 28 May 2026 00:32:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wSOfV-00ALZa-1o for pgsql-hackers@arkaria.postgresql.org; Thu, 28 May 2026 00:32:14 +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 1wSOfV-00ALZR-0s for pgsql-hackers@lists.postgresql.org; Thu, 28 May 2026 00:32:14 +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 1wSOfT-00000001m8a-43it for pgsql-hackers@lists.postgresql.org; Thu, 28 May 2026 00:32:13 +0000 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-3922b35e69cso97260221fa.0 for ; Wed, 27 May 2026 17:32:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1779928331; cv=none; d=google.com; s=arc-20240605; b=XDMdekaBs294n2iBHGqfxkbT4NlT58xfTrBF3GfXgX2YXqsk/+w+dHfnGkAAkJeOAb tZVzGW3m/ZUhk6N0SVMrthooTrx3W6oQaZXg8euazy3mRWLcbUn+yrl+dJqPgaenSmgF D9uvHdfVMvxi8FvFdVJEEfmsbehh4Eny/ovw0R+1EG34UHJbYt1Be/tX2HdPgBrU4du9 cHBc+lY3M/IPWi4ExgrK9aoZCOGIuodUvdKpxxQs6npkPnGoHdadwbkJR3L84bNIkezR CI/a3uvgB2tIwk+ys1ZNRfcRwVt5UyAEytgUKfQ1OgPZkV0amUKVKqEook+252z4BRmL DnEw== 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=x2tceo+SzSpsLsSZvxK9Mk2L9EzhKKt2M0ofcqu6RG0=; fh=eK3HuYDQupt8mOmaOAhy2dlUB/M/LBY+7p5Oqe7UVtY=; b=CZclhJueNmOhJNv80k7aLcGwRqpsa8/ydOY4x5sP7RotgwQB+B4jtTpy4uKs3cV+JG zo4v4zsylWVVtZ7/RXEWDxRRueFHzOD7u0vf85WULfkfXLIqhlbcWqH5vRb06VwsPodO rE3BCtdV1Ur6ymGs7dbxIH9xt3acxS/rxzEwTFsFdFJLRnpZGCmKO+yaiGetg/e4MIjP gyhbsRnjEJA2y8gqREH1cd/hCLlEcNozuz9LXSKl7TX6XJ+tvsPAGWoIFq/+hTWm4iEO OYvO5ADGijGciI1ceRtxTSI0vpupSVPYUwLq7KwtMTPuYdgt00btUInZt3CfugoJLIFc DF1A==; 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=1779928331; x=1780533131; 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=x2tceo+SzSpsLsSZvxK9Mk2L9EzhKKt2M0ofcqu6RG0=; b=E7y/skjHvhwWp9db/7WdJMdqXZULWVp0lnGdbB/eVe/pbNUhL3NKsinaazy+0bPd5a zCjGxt8WC2TeIIij4z9LTnAodzqNwBZOhRRwaKLfRlfZWrN9nVBdZ8BlbVY0dFHWMN3g fPPar8QtSzOjwMmBaWQjNUMMNpLPhZ8y9LWRgHHKhFlY4OzofC7njAzvNpAyXBeszTKQ 3enOwfmlB92g1fhx9SuK5F4JYBshUvZ2WunqqRvqQG5knPd85EtEScgg/8AYzESmdLwB lQDhf72l8cbdEdm+6zsAzqxxYtmo092MAiyg4CZldzL9rjRifPBfh6CnyFxISxr3sXfp H9bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779928331; x=1780533131; 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=x2tceo+SzSpsLsSZvxK9Mk2L9EzhKKt2M0ofcqu6RG0=; b=IyKSWJilAf23D6+37i2wwCfpQmot9pgJ3NhGXgn716usTZg6uzRXnLQuR6IhhZ3eee tGNXDMGT3QfuOL9A0dXsnquTVg8RttgLikuEw/o6DubNR98gRlhfZOalROVMWQVO9dBf 6+mfVdYs7kgV2hMGc9p0RFgqS4y07x+myNo2/9vPDEmPIgueqpKtiCeVh7EYdLO6rbPX ucB9r6tgazEs/Y5r50Ve5x8ksycy1L5VTkROAIBumYqfpoK+gfK+kFKOQs16gwlPEfTv F2q1Wv87w/6q6tSB+Ow/O5Ffj9H7Tpm27Tn+nv6NywHP5ue/jqMIRhdez5LLgB8FpRsn 2eAg== X-Forwarded-Encrypted: i=1; AFNElJ8TZ90RA6qtLUPqjIiN7/H1eSL2/w0BjeCuNlvyRFWEyz5vVIVqSepytsA1tbsmtCJwXAy6v9z75mBHygw0@lists.postgresql.org X-Gm-Message-State: AOJu0YyWwbeBQxZvfkn5Z/sAnSu1R67iBycxJRShGj6+LfD3g7qCKLHs BP4yAVomzBb3MYdohwpwDwABW3797Whs6neRx0JWRaDnGlAVlTvwYu7ozDnkrrOpL4HkkepVvWK FPnsMBBW0KdwNP29UuRitTNnV1vXPW4I= X-Gm-Gg: Acq92OF7ivCnIPugUjUi9NZHXie02x4zbfq7LDTQ93ZRVdJfk+vGdJo3hynoVssEt+y UMAMs80ayBEvo3IGlIROPlmj0oThMgij2M6AewMFOZ6frW8m4iCEKarWPDbYLiUu0g7tlKB2V4b uMoZztgowwjbozQt4tIsduoUt4EXbWulkZYTN8sxuPiVp8saqo7hwmv8/TtvL1Hf5SFQIS3zO41 6XL5sJePvw37OEvXWbLT8bWXJ9ixl772juxDeGZuvUYiDNZ9WSC19rBJ4R6/8QFRHifDGXOIQIv +oQ7rgQD20YnZN2GQNPL98NY1BTBCU8PQMxt1+MnCWdZdO3TqGhCSMgldRvHw93Fk9Cv3Z/nuHE cJ0U3VHa7gTZlifFdrVR4mxhJpvg1 X-Received: by 2002:a2e:8446:0:b0:38b:e464:f047 with SMTP id 38308e7fff4ca-395d8cac6a7mr63977221fa.12.1779928330497; Wed, 27 May 2026 17:32:10 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Amit Kapila Date: Wed, 27 May 2026 17:31:59 -0700 X-Gm-Features: AVHnY4JAcpsBg3iVlJaadQZ7n8pp-nYpHSoflRy4HZ_dsV6BW6dthC1VWgpmlXI Message-ID: Subject: Re: Adding REPACK [concurrently] To: "Zhijie Hou (Fujitsu)" Cc: Alvaro Herrera , Antonin Houska , "Hayato Kuroda (Fujitsu)" , Srinath Reddy Sadipiralla , Mihail Nikalayeu , 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, May 27, 2026 at 1:08=E2=80=AFAM Zhijie Hou (Fujitsu) wrote: > > 0001 remains unchanged. > Few minor comments: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D * + * To allow old WAL files to be recycled, we manually advance the + * slot each time a WAL segment boundary is crossed. This is safe only because REPACK creates a temporary slot that is dropped if REPACK fails =E2=80=94 there's no scenario where this slot needs= to restart decoding from an earlier position while still alive. I feel that is worth a mention. * @@ -1910,8 +1910,14 @@ LogicalConfirmReceivedLocation(XLogRecPtr lsn) SpinLockRelease(&MyReplicationSlot->mutex); ReplicationSlotsComputeRequiredXmin(false); - ReplicationSlotsComputeRequiredLSN(); } + + /* + * Now the new restart_lsn is safely on disk, recompute the global WAL + * retention requirement. + */ + if (updated_restart) + ReplicationSlotsComputeRequiredLSN(); This change is not related to this patch, rather we need it even without this patch, is it worth mentioning in the commit message? --=20 With Regards, Amit Kapila.