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 1w0faG-0026ir-1c for pgsql-docs@arkaria.postgresql.org; Thu, 12 Mar 2026 12:56:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w0faE-00EymZ-2q for pgsql-docs@arkaria.postgresql.org; Thu, 12 Mar 2026 12:56:11 +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 1w0NcK-00AdgQ-17 for pgsql-docs@lists.postgresql.org; Wed, 11 Mar 2026 17:45:08 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w0NcH-00000001dzV-3lta for pgsql-docs@lists.postgresql.org; Wed, 11 Mar 2026 17:45:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Message-ID:Date:Reply-To:Cc:From:To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:Sender:Content-ID: Content-Description:In-Reply-To:References; bh=GestzUYw6G2GROkpLP4348jVFZtEmUclzLaYpKJHNFI=; b=xpVjjinjYc0mMxHInxDM1dx6wR SPxhtPtnaI5xsdLRcXwH+lUylbqhNucikoGaW+AINWSy6tC1vDA+oXweWPy0Uctfvk9xS0AAHIReP tfhzjY723AUWVCuJCg8ZbO018sKJCuT/K0OZnkOrc3v1DVuDn7XgVp/Gjm5g4aI3BhwgFftNx+ygi 848/NRqOh8BnI7p6sl6PEzgZkyddv9CnYvuiE0Hy0YAjFoiBwGpZc9XwN2JfYS47BxLXRVOQPiVdu xoaR4o4LhZP+4cnAuL63UbNQ/1BsJskU+dvQw3b8dgUsG9rN53UhkiCmh0YQUe4f6opc6mlMglBts BOs26wHw==; Received: from wrigleys.postgresql.org ([2a02:16a8:dc51::60]) by mahout.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w0NcH-0040y4-0H for pgsql-docs@lists.postgresql.org; Wed, 11 Mar 2026 17:45:05 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w0NcE-008ESD-2c for pgsql-docs@lists.postgresql.org; Wed, 11 Mar 2026 17:45:04 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: Clarifying pg_rewind failure risks due to asynchronous file deletions To: pgsql-docs@lists.postgresql.org From: PG Doc comments form Cc: juliana.crespo@enterprisedb.com Reply-To: juliana.crespo@enterprisedb.com, pgsql-docs@lists.postgresql.org Date: Wed, 11 Mar 2026 17:44:45 +0000 Message-ID: <177325108551.1938400.15560714772530033016@wrigleys.postgresql.org> X-Auto-Response-Suppress: All Auto-Submitted: auto-generated List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk The following documentation comment has been logged on the website: Page: https://www.postgresql.org/docs/18/app-pgrewind.html Description: Reference Page: https://www.postgresql.org/docs/current/app-pgrewind.html Proposed Enhancement: Include an explicit warning in the **"Description"** or **"Warnings"** section regarding the requirement for the target data directory to remain static during the rewind process. Reasoning: While the documentation states that `pg_rewind` "will fail immediately if it finds files it cannot write directly to," it does not currently warn against asynchronous file deletions within the target `$PGDATA` (or tablespace/WAL directories) while the utility is running. In high-concurrency or automated environments, background processes=E2=80= =94such as the **WAL summarizer** cleanup, automated log rotations, or external archiver tools (e.g., `pgbackrest` spooling)=E2=80=94may remove files that `pg_rewind` has already indexed for synchronization. This results in a fatal "No such file or directory" error during the final stages of the rewind, often leaving the target directory in an unrecoverable state. Suggested Phrasing: "Warning: The target data directory must remain static during the rewind operation. Any asynchronous file modifications or deletions=E2=80=94such as= those performed by automated log rotation, WAL summary cleanups, or external backup tools=E2=80=94may cause `pg_rewind` to fail. If a file is removed af= ter the synchronization process has begun, the utility may error out, leaving the target cluster in an inconsistent state that requires a new base backup."