Re: Review for GetWALAvailability()

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: masao(dot)fujii(at)oss(dot)nttdata(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Review for GetWALAvailability()
Date: 2020-06-17 18:50:14
Message-ID: 20200617185014.GA3714@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksei Ivanov 2020-06-17 18:55:44 Binary transfer vs Text transfer
Previous Message Andres Freund 2020-06-17 18:33:54 Re: global barrier & atomics in signal handlers (Re: Atomic operations within spinlocks)