pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: masao.fujii@oss.nttdata.com
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Review for GetWALAvailability()
Date: Wed, 17 Jun 2020 14:50:14 -0400
Message-ID: <20200617185014.GA3714@alvherre.pgsql> (raw)
In-Reply-To: <20200617.135607.687059791532071892.horikyota.ntt@gmail.com>

On 2020-Jun-17, Kyotaro Horiguchi wrote:

> @@ -342,7 +351,14 @@ pg_get_replication_slots(PG_FUNCTION_ARGS)
>  		else
>  			nulls[i++] = true;
>  
> -		walstate = GetWALAvailability(slot_contents.data.restart_lsn);
> +		/* use last_invalidated_lsn when the slot is invalidated */
> +		if (XLogRecPtrIsInvalid(slot_contents.data.restart_lsn))
> +			targetLSN = slot_contents.last_invalidated_lsn;
> +		else
> +			targetLSN = slot_contents.data.restart_lsn;
> +
> +		walstate = GetWALAvailability(targetLSN, last_removed_seg,
> +									  slot_contents.active_pid != 0);

Yeah, this approach seems better overall.  I'll see if I can get this
done after lunch.

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





view thread (38+ messages)  latest in thread

Message-ID: <20200617185014.GA3714@alvherre.pgsql>
Permalink:  ../20200617185014.GA3714@alvherre.pgsql/
Also on:    postgresql.org/message-id/20200617185014.GA3714@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@2ndquadrant.com, horikyota.ntt@gmail.com, masao.fujii@oss.nttdata.com
  Subject: Re: Review for GetWALAvailability()
  In-Reply-To: <20200617185014.GA3714@alvherre.pgsql>
  References: <20200617.135607.687059791532071892.horikyota.ntt@gmail.com> <20200617185014.GA3714@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