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 1w0m8g-002CL1-1Q for pgsql-docs@arkaria.postgresql.org; Thu, 12 Mar 2026 19:56:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w0m8e-00HHKO-28 for pgsql-docs@arkaria.postgresql.org; Thu, 12 Mar 2026 19:56:09 +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 1w0m8e-00HHKG-1K for pgsql-docs@lists.postgresql.org; Thu, 12 Mar 2026 19:56:08 +0000 Received: from mail-ed1-x541.google.com ([2a00:1450:4864:20::541]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w0m8c-00000001ozH-3vzY for pgsql-docs@lists.postgresql.org; Thu, 12 Mar 2026 19:56:08 +0000 Received: by mail-ed1-x541.google.com with SMTP id 4fb4d7f45d1cf-6616cb8c80cso2143280a12.0 for ; Thu, 12 Mar 2026 12:56:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1773345364; x=1773950164; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=sGEpbSiSBCLrVL0KsUeeRq/KkC0sc1EljAMib2w0Wi8=; b=mZ7Bhg6PKRtBW2jpIhtLjsjWRsXVLtu2FgpDcE+Fp9ifiD4cycgvKYw2MCFtnDbwY6 /T7xUYmr8ruggNpq4tcsLfOlhO9B/sSLh41ypoG6e8XwrV8WkFFIv+pg/WEtcQylZ5Q9 lTp9hQXL/9haZfvWViNFYrRIbQKki5HRJEmnDn3yVXHEmdB41pTbCV7OS0YqSUm80PK6 YXzhJWTRgvqD+Eur5GP7TfrsHUet/pahk6e8cSW3bUY06BEiW6rmXgbd8MAre+t/0FPQ oJheczob5ncnZzV6G4EMNV5gj8q6zrsarVHMKG1tFHAbsZMlPhYftECCsTHlGegqjM2F G0KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773345364; x=1773950164; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=sGEpbSiSBCLrVL0KsUeeRq/KkC0sc1EljAMib2w0Wi8=; b=FH0UYNwRe0TFGYhxBufL6v3x5DeJhfnR6PwZyfW0oEMXqdJa43iqwtfhFWgTOkqxos pSSfIhekAf78bLHwqz8+vkndmJv28Wo4wGXAW37B/vtNbN31Pu+tGcg3eiLRr9VVBAhS NC1JijbE/OahNDupsfZ7voIG5Z4lBwc4CX/rsM04Y2+HhcwTVGxXwbibj01I24YnFPtb w/ALDNDwYSAeOhv+m3HA9WFWiVr+3NL4K9dhqCKY4p90jMR8kItDfPaM5svqkKUlpkzz 1ph4/CfILidn0pS5HifbtkNRI3FmmeT4g39PzSP7x4Hz3meGVxX2TDGzbhLXLYZPL7+S iiAA== X-Forwarded-Encrypted: i=1; AJvYcCXpbjnz3fnJTG2Vs5rss5Hcz6nQ2jMK90AKN9LF8XOHsmHWhct8dvX0iXNmhdXABlGp058HX2gWxXQ/@lists.postgresql.org X-Gm-Message-State: AOJu0Yy2M/hv+2e40hAzys2v/r90OVbE5erUysDYAK5lPVAvzVz0Xxpv FrDccvwEG+IUHAQz6P2Sda0xxk8FoEyxRoMsoalufdNesBqwYK57Ectx1KdqNVEjEv00ypYELl5 YG7GoY47pQw== X-Gm-Gg: ATEYQzwlJvqBlYpH/fNK65ISL2TMT8I8OXQtiQvj21Ej6LTgeNSQE68MW1vE/G7F2zi sPq1ILEArQ7rVdvUZlV3YmIeS5bHb22mgmbdyaA0PASQKpIegawZQqRxtiWs6KLqztS2doBM8PW 7oPdrtzAfDrBmvuuwrOKBL1cP3u3CtKKDdFY/2zIIKNvv4ku4ZArqxxvauAP0eTP4RN0IkrA6nt 0L3ha2f3uoLt8bRW4rl9wV2JsaPvnpBfs0xDi/+1UUGoeiakDUnUNg0TRRjTxl9R316F6BHID3v oMTqGjoCEisNNBV3Vn4fRfoi0jP4R9YQfm1gnOeihHYilmRxSAaO6laeERWXtsljVldElhkX9iH xZTgdOUZBUtCsvahhTZKSjIJrmN3WgSkvY4ql9clIlWaDlEu6ggIMqA8jBFQmoy9LiOCc4sh6oZ MbWSHeJ+cZK+aSpr9f39aVa0U2T8Ya6KDnTGxAc4WabQ8gI2Fm5UiTfe3vKTtFPwZhJJgGsmcqQ uG7F6aSop0OBq/fxq1ShGQRlJ6KDpGvnpNn X-Received: by 2002:a17:907:7389:b0:b96:ee7e:a65d with SMTP id a640c23a62f3a-b976538221fmr27436666b.58.1773345364247; Thu, 12 Mar 2026 12:56:04 -0700 (PDT) Received: from laurenz.albe-K4N0CV00F97414D (dynamic-046-114-168-089.46.114.pool.telefonica.de. [46.114.168.89]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b9766ab3b1csm10006166b.14.2026.03.12.12.56.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2026 12:56:04 -0700 (PDT) Message-ID: <13177aa3d39d37acc4cb2f258643dee56f4dfb50.camel@cybertec.at> Subject: Re: Clarifying pg_rewind failure risks due to asynchronous file deletions From: Laurenz Albe To: juliana.crespo@enterprisedb.com, pgsql-docs@lists.postgresql.org Date: Thu, 12 Mar 2026 20:56:00 +0100 In-Reply-To: <177325108551.1938400.15560714772530033016@wrigleys.postgresql.org> References: <177325108551.1938400.15560714772530033016@wrigleys.postgresql.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.3 (3.58.3-1.fc43) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2026-03-11 at 17:44 +0000, PG Doc comments form wrote: > Reference Page: https://www.postgresql.org/docs/current/app-pgrewind.html >=20 > 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. >=20 > 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. >=20 > 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 tha= t > `pg_rewind` has already indexed for synchronization. This results in a fa= tal > "No such file or directory" error during the final stages of the rewind, > often leaving the target directory in an unrecoverable state. >=20 > Suggested Phrasing: >=20 > "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 = after the > synchronization process has begun, the utility may error out, leaving the > target cluster in an inconsistent state that requires a new base backup." I'd say that it is obvious that nobody should mess with the target data directory while pg_rewind is working on it. Nothing except PostgreSQL itself should ever mess with the data directory, period. The WAL summarizer is part of PostgreSQL. You are not trying to tell us that you started the PostgreSQL server on the data directory while you ran pg_rewind, are you? It is also not documented that you shouldn't power down the machine while you are running pg_rewind. Or remove the disk. Yours, Laurenz Albe