Re: Non-reserved replication slots and slot advancing

From: Andres Freund <andres(at)anarazel(dot)de>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org, petr(at)2ndquadrant(dot)com, simon(at)2ndQuadrant(dot)com
Subject: Re: Non-reserved replication slots and slot advancing
Date: 2018-07-10 08:16:30
Message-ID: 20180710081630.h2m6x4t4ts4zkfsm@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018-07-10 16:59:07 +0900, Michael Paquier wrote:
> On Tue, Jul 10, 2018 at 12:26:30AM -0700, Andres Freund wrote:
> > Why is the ReplicationSlotRelease() needed here? Souldn't the error
> > handling code do so automatically?
>
> Oh, indeed. I didn't know that PostgresMain was doing some cleanup
> here. There is a second place where this can be removed, which comes
> from the original commit which added the advance function.

Gna, it's almost like the original code wasn't properly reviewed.

> An updated version is attached. Do you have other comments?

Looks sane, without having tested it.

> if (moveto < minlsn)
> - {
> - ReplicationSlotRelease();
> ereport(ERROR,
> (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
> - errmsg("cannot move slot to %X/%X, minimum is %X/%X",
> + errmsg("cannot advance replication slot to %X/%X, minimum is %X/%X",
> (uint32) (moveto >> 32), (uint32) moveto,
> (uint32) (minlsn >> 32), (uint32) minlsn)));
> - }

If you're touching this, I'd also change the errcode here.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message 이재훈 2018-07-10 08:19:25 [Tiny Debug Issue] Undefined Reference problem encountered during compile
Previous Message Haribabu Kommi 2018-07-10 08:04:30 Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query