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 1vWaUp-00576D-1r for pgsql-general@arkaria.postgresql.org; Fri, 19 Dec 2025 13:26:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vWaUo-007lIg-1P for pgsql-general@arkaria.postgresql.org; Fri, 19 Dec 2025 13:26:15 +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 1vWaUo-007lIX-07 for pgsql-general@lists.postgresql.org; Fri, 19 Dec 2025 13:26:14 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vWaUm-001VhY-1Y for pgsql-general@lists.postgresql.org; Fri, 19 Dec 2025 13:26:13 +0000 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-2a0834769f0so16409395ad.2 for ; Fri, 19 Dec 2025 05:26:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766150770; x=1766755570; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=x4z+3NXckJvmy80X5lcSmhjhI9fekY/wmufut5QYJsM=; b=YutFv3MYz24gbKAxZmVWg8UkFQKOHIc0Yc6rmz/z3zoocbBR4dcvlIoJZg6BW8MuQR L+VOxFg4+NqiiD2wBJkUV9F6+ju/KKuhjsaqmH5vbM3vG95TbsPkX1NzjKYWHWo6aCxW 9JZcOipTZ/iUX7eoNbuW3avWH2RL6AYCa5O7jwxqERZXvBfAeCU8uDPaUjOTv4ftex+K aTzxzNgFFyGSS+k78QP12gkpUwXj+dvHxzO1Bp7PvvnZ/UiNK5rHfH7u5sw1UpTG0CmN jekBG1RJUdpV2PgUP0iz32jQsS8ojugiAy0KQKMeKsbldXd7LuZ0+b6elevXJsPAY2UG gVAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766150770; x=1766755570; h=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=x4z+3NXckJvmy80X5lcSmhjhI9fekY/wmufut5QYJsM=; b=M3lytxjk7+zJe9+Qv0ASP7XOHDv0ag9c+VxHe6TGF+iD01Q52y3Pk859rz0B9bMnSy /5aAy7o+MM1dnplg9/36DY3EIh4Lnyu61lBShotKNB74tAbeD8C2Ibmc9aNZyn5BRTZX 9e+zKXwfAmrEBCP71c0VRLZtpQQr8kAXxO4l2jp9rpsJRdrBSEnZRRTgNvXMLq3s5AWp mUdy0GLY4ot6s49Qx7vtW79zcE9Gk+88VgYccWJC1Zdhkz9pMkyOBn+b2V0ixhQqab1u ve5AH9gXJwnowYZQxsYVaE2Zh8wPpzoFhNpjN3U2XKSUhIzzIBlt7RhNarEi69RGJcr4 b3GA== X-Forwarded-Encrypted: i=1; AJvYcCWgm/pHG7mWBxJXiIH9mTi/77jkvoEWBuoXDuwlY/NPm++xXc2OYDd6WOWsjKIpVcIjXXdEALvUMCcuOVDG@lists.postgresql.org X-Gm-Message-State: AOJu0Yxea77jSKS6VxrKPGYvkyPsG+7jNWcnrSU6RSnl0lvok4ItJ/FC 1E99caHYoVZHkyinlqXLuy/QUnOAvJL1lshop3pXWNp+FzrnBSEwxFIbyZ73ypbN9wzcQ/9nh5O IjZ7Az32ljJZvlEwQk3ZXhFvhQnVxBfA= X-Gm-Gg: AY/fxX6pq883Rfe1JFPduuq8EE323gO9Lv0EUidH4dPGe/C9UyHSgHANVV3UmN47A+P zO9WtPXRCMBUjJ0snkZ8ZrUfyZdxyWmuh9Eql8etqeyD66YjWMInsvGVrDCer64WfsOp7WGIbXL ZwL4lc9+EZUf0plmdS8HMcqLJy803poyxs7EhsDq2gFKIpItbsvOUuwmMHo5OtfCwVPsNarHLFn PFqvsYjlr//+LCUuFQZc5+/PpBG7eeT6oGwJejDdUXzjliICVtm53AEkY0L8Z6Cq01oaDF9A//v l9EhnO5K1gad2FRUf4wZk4mXUmej2a2hgwj+WcbezOkzcsvn8WvvLRXfrQzTl34elbXLbMmsmaX 2vitLcLb8x7BClStvxb+u6MsXrdvrKzT3J+yGOcUsdTI3vHZHyk4s3GzDVnYmdT5aZOST X-Google-Smtp-Source: AGHT+IFFde+CcYvm1vXbQN624QwRg0Rlz4rB9HhowloG2ayPbwK3ISUFe0ZzjDNJYdCakBZKz30L6OrUon75P2Ei98k= X-Received: by 2002:a05:701b:2403:b0:119:e56b:91d1 with SMTP id a92af1059eb24-121721aaf82mr1906467c88.2.1766150770204; Fri, 19 Dec 2025 05:26:10 -0800 (PST) MIME-Version: 1.0 References: <4e2cfc51d3933a1df28e212ccb0b90f39633422a.camel@cybertec.at> <2890CAF1-6B00-440E-B8FF-3D333DFC5AF3@gmail.com> In-Reply-To: From: "Colin 't Hart" Date: Fri, 19 Dec 2025 14:25:58 +0100 X-Gm-Features: AQt7F2ono792ck0YNlaZuxM1s8TwBJC-Ya8HWK5WuW7QFvgbDI9zknzNsVQU7A8 Message-ID: Subject: Re: wal segment size To: Laurenz Albe Cc: Andrew , Greg Sabino Mullane , PostgreSQL General Content-Type: multipart/alternative; boundary="0000000000004726b506464e050a" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000004726b506464e050a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable What's the behaviour when pg_resetwal is used to change the WAL segment size? This note is worrying to me: -- While pg_resetwal will set the WAL starting address beyond the latest existing WAL segment file, some segment size changes can cause previous WAL file names to be reused. It is recommended to use -l together with this option to manually set the WAL starting address if WAL file name overlap will cause problems with your archiving strategy. -- Why can a segment size change cause previous WAL file names to be reused? Do we need to take a new backup immediately after changing the WAL segment size? Thanks, Colin On Fri, 19 Dec 2025 at 14:09, Laurenz Albe wrote= : > On Fri, 2025-12-19 at 09:26 +0100, Andrew wrote: > > As an oracle dba new to Postgres, I=E2=80=99m used to the concept of co= ntext > switches and latch issues > > with regards to transaction log switches. Does Postgres have a similar > mechanism with latching > > etc when it switches to a new wal segment that is alleviated when > increasing the size of the > > wal segments? > > Not really. PostgreSQL doesn't reuse WAL segments in a circular fashion > like Oracle does. > At the end of a checkpoint, it creates new, empty WAL segments for future > use, so if there > is a need to switch to a new segment, there is no need to wait for > anything. > > Yours, > Laurenz Albe > --0000000000004726b506464e050a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
What's the behaviour when pg_resetwal is used to = change the WAL segment size?

This note is worrying= to me:
--
While pg_reset= wal will set the WAL starting address beyond the latest existing WAL segment file, some segment size=20 changes can cause previous WAL file names to be reused. It is=20 recommended to use -l together with thi= s=20 option to manually set the WAL starting address if WAL file name overlap will cause problems with your archiving strategy.
--
W= hy can a segment size change cause previous WAL file names to be reused?

Do we need to take a new backup immediately after ch= anging the WAL segment size?

Thanks,
Colin

On Fri, 19 Dec 2025 at 14:09, = Laurenz Albe <laurenz.albe@c= ybertec.at> wrote:
On Fri, 2025-12-19 at 09:26 +0100, Andrew wrote:
> As an oracle dba new to Postgres, I=E2=80=99m used to the concept of c= ontext switches and latch issues
> with regards to transaction log switches. Does Postgres have a similar= mechanism with latching
> etc when it switches to a new wal segment that is alleviated when incr= easing the size of the
> wal segments?

Not really.=C2=A0 PostgreSQL doesn't reuse WAL segments in a circular f= ashion like Oracle does.
At the end of a checkpoint, it creates new, empty WAL segments for future u= se, so if there
is a need to switch to a new segment, there is no need to wait for anything= .

Yours,
Laurenz Albe
--0000000000004726b506464e050a--