pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgbf@twiska.com, Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: masao.fujii@oss.nttdata.com
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: min_safe_lsn column in pg_replication_slots view
Date: Thu, 9 Jul 2020 18:20:04 -0400
Message-ID: <20200709222004.GA10331@alvherre.pgsql> (raw)
In-Reply-To: <2008607.1594331766@sss.pgh.pa.us>

On 2020-Jul-09, Tom Lane wrote:

> and even the most cursory look at the code confirms that there's a
> real bug here.  KeepLogSeg expects *logSegNo to be defined on entry,
> but GetWALAvailability hasn't bothered to initialize oldestSlotSeg.
> It is not clear to me which one is in the wrong; the comment for
> KeepLogSeg isn't particularly clear on this.

Oh, so I introduced the bug when I removed the initialization in this
fix.  That one was using the wrong datatype, but evidently it achieved
the right effect.  And KeepLogSeg is using the wrong datatype Invalid
macro also.

I think we should define InvalidXLogSegNo to be ~((uint64)0) and add a
macro to test for that.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (72+ messages)  latest in thread

Message-ID: <20200709222004.GA10331@alvherre.pgsql>
Permalink:  ../20200709222004.GA10331@alvherre.pgsql/
Also on:    postgresql.org/message-id/20200709222004.GA10331@alvherre.pgsql

 · 

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-hackers@postgresql.org
  Cc: alvherre@2ndquadrant.com, tgl@sss.pgh.pa.us, horikyota.ntt@gmail.com, masao.fujii@oss.nttdata.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: min_safe_lsn column in pg_replication_slots view
  In-Reply-To: <20200709222004.GA10331@alvherre.pgsql>

* 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