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 michael.paqu...@gmail.com wrote: On Thu, Oct 16, 2014 at 7:09 PM, Simon Riggs si...@2ndquadrant.com wrote: I find it confusing that the Lowest pointer value is also Invalid. Valid != Invalid In complement to that, note that I mentioned

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

2014-10-16 Thread Simon Riggs
On 12 September 2014 13:16, Michael Paquier michael.paqu...@gmail.com wrote: On Fri, Sep 12, 2014 at 4:55 PM, Heikki Linnakangas hlinnakan...@vmware.com 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

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 si...@2ndquadrant.com 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-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 hlinnakan...@vmware.com 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

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 michael.paqu...@gmail.com 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

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 hlinnakan...@vmware.com 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

[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

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 michael.paqu...@gmail.com 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