Re: [HACKERS] Incorrect initialization of sentPtr in walsender.c

2014-11-18 Thread Michael Paquier
On Thu, Oct 16, 2014 at 9:01 PM, Michael Paquier wrote: > On Thu, Oct 16, 2014 at 7:09 PM, Simon Riggs > wrote: > >> I find it confusing that the "Lowest" pointer value is also "Invalid". >> Valid != Invalid >> > In complement to that, note that I mentioned Invalid should be UINT_MAX > for clari

Re: [HACKERS] Incorrect initialization of sentPtr in walsender.c

2014-10-16 Thread Michael Paquier
On Thu, Oct 16, 2014 at 7:09 PM, Simon Riggs wrote: > I find it confusing that the "Lowest" pointer value is also "Invalid". > Valid != Invalid > In complement to that, note that I mentioned Invalid should be UINT_MAX for clarity. -- Michael

Re: [HACKERS] Incorrect initialization of sentPtr in walsender.c

2014-10-16 Thread Simon Riggs
On 12 September 2014 13:16, Michael Paquier wrote: > On Fri, Sep 12, 2014 at 4:55 PM, Heikki Linnakangas > wrote: >> I haven't looked at those places closely, but it seems possible that at >> least some of those variables are supposed to be initialized to a value >> smaller than any valid WAL pos

Re: [HACKERS] Incorrect initialization of sentPtr in walsender.c

2014-10-13 Thread Michael Paquier
On Tue, Oct 14, 2014 at 5:18 AM, Bruce Momjian wrote: > On Fri, Sep 12, 2014 at 09:16:42PM +0900, Michael Paquier wrote: >> Patch attached in case. > I like this. Can we apply it Heikki? I actually registered it to the next CF so as it does not fall into oblivion, simply forgot to mention it: htt

Re: [HACKERS] Incorrect initialization of sentPtr in walsender.c

2014-10-13 Thread Bruce Momjian
On Fri, Sep 12, 2014 at 09:16:42PM +0900, Michael Paquier wrote: > On Fri, Sep 12, 2014 at 4:55 PM, Heikki Linnakangas > wrote: > > I haven't looked at those places closely, but it seems possible that at > > least some of those variables are supposed to be initialized to a value > > smaller than a

Re: [HACKERS] Incorrect initialization of sentPtr in walsender.c

2014-09-12 Thread Michael Paquier
On Fri, Sep 12, 2014 at 4:55 PM, Heikki Linnakangas wrote: > I haven't looked at those places closely, but it seems possible that at > least some of those variables are supposed to be initialized to a value > smaller than any valid WAL position, rather than just Invalid. In other > words, if we de

Re: [HACKERS] Incorrect initialization of sentPtr in walsender.c

2014-09-12 Thread Heikki Linnakangas
On 09/12/2014 03:17 AM, Michael Paquier wrote: On Fri, Sep 12, 2014 at 9:08 AM, Michael Paquier wrote: In walsender.c, sentPtr is initialized as follows: static XLogRecPtr sentPtr = 0; Isn't that incorrect and shouldn't we use InvalidXLogRecPtr instead? Actually by looking more around I found

Re: [HACKERS] Incorrect initialization of sentPtr in walsender.c

2014-09-11 Thread Michael Paquier
On Fri, Sep 12, 2014 at 9:08 AM, Michael Paquier wrote: > In walsender.c, sentPtr is initialized as follows: > static XLogRecPtr sentPtr = 0; > Isn't that incorrect and shouldn't we use InvalidXLogRecPtr instead? Actually by looking more around I found a couple of extra places where the same incon

[HACKERS] Incorrect initialization of sentPtr in walsender.c

2014-09-11 Thread Michael Paquier
Hi all, In walsender.c, sentPtr is initialized as follows: static XLogRecPtr sentPtr = 0; Isn't that incorrect and shouldn't we use InvalidXLogRecPtr instead? Patch is attached. Regards, -- Michael diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c index 844a5d