Re: Duplicated assignment of slot_name in walsender.c - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Duplicated assignment of slot_name in walsender.c
Date
Msg-id 20151027162703.GF240637@alvherre.pgsql
Whole thread Raw
In response to Re: Duplicated assignment of slot_name in walsender.c  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Andres Freund wrote:

> If you want to do that, I'm unenthusiastically not objecting. But if so,
> let's also do it in IdentifySystem(), SendTimeLineHistory(),
> StartReplication(), SendBackupHeader(), SendXLogRecPtResult() - they're
> modeled after each other.

Okay, pushed with that, backpatched to 9.4 which is where it all applied
with no conflicts, to ease future backpatching pain.  (Some of this code
exists back in 9.3, but git generated a lot of conflicts in
cherry-picking so I didn't bother).

In SendXLogRecPtrResult() we now rely on snprintf's return value, rather
than doing a separate strlen call.  We do have some other places (not a
lot admittedly) in which we rely on snprintf returning correctly.  I
assume that's the norm when there's no possibility of failure.

I wonder why we use MAXFNAMELEN to print %X/%X -- that seems odd.

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



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Rework the way multixact truncations work
Next
From: Merlin Moncure
Date:
Subject: Re: fortnight interval support