pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: zhjwpku@gmail.com
Cc: xu.xw2008@163.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17903: There is a bug in the KeepLogSeg()
Date: Fri, 21 Apr 2023 14:43:47 -0700
Message-ID: <20230421214347.GA1441786@nathanxps13> (raw)
In-Reply-To: <20230421.104231.1594652765237022266.horikyota.ntt@gmail.com>
References: <CAEG8a3L2BB5k9USO4fC_wQjULGX-1rqaX2JSHn1_0vco8KB28Q@mail.gmail.com>
	<20230420.175814.1157027125103997227.horikyota.ntt@gmail.com>
	<20230420220242.GB1435672@nathanxps13>
	<20230421.104231.1594652765237022266.horikyota.ntt@gmail.com>

On Fri, Apr 21, 2023 at 10:42:31AM +0900, Kyotaro Horiguchi wrote:
> From what I understand, the XLogSegNo calculations are designed
> without considering the actual value range. Basically, it assumes that
> (XLogSegNo + <any positive int>) can overflow.  If we take the actual
> value range into account, we can make that change.
> 
> The choice lies on whether we assume the actual value range or not.

Yeah, after staring at this some more, I think your proposed fix is the way
to go.  Alternatively, we could adjust the conditional for the
max_slot_wal_keep_size block to

	if (keep != InvalidXLogRecPtr && keep < recptr)

but AFAICT that yields the exact same behavior.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com





view thread (13+ messages)  latest in thread

Message-ID: <20230421214347.GA1441786@nathanxps13>
Permalink:  ../20230421214347.GA1441786@nathanxps13/
Also on:    postgresql.org/message-id/20230421214347.GA1441786@nathanxps13

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: nathandbossart@gmail.com, horikyota.ntt@gmail.com, zhjwpku@gmail.com, xu.xw2008@163.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17903: There is a bug in the KeepLogSeg()
  In-Reply-To: <20230421214347.GA1441786@nathanxps13>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox