Re: Incorrect initialization of sentPtr in walsender.c

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: Incorrect initialization of sentPtr in walsender.c
Дата
Msg-id 5412A6FF.6030008@vmware.com
обсуждение исходный текст
Ответ на Re: Incorrect initialization of sentPtr in walsender.c  (Michael Paquier <michael.paquier@gmail.com>)
Ответы Re: Incorrect initialization of sentPtr in walsender.c  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
On 09/12/2014 03:17 AM, Michael Paquier wrote:
> On Fri, Sep 12, 2014 at 9:08 AM, Michael Paquier
> <michael.paquier@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 places where
> the same inconsistencies are present, mainly in xlog.c and
> walreceiver.c. Updated patch attached for all those things.

InvalidXLogRecPtr == 0, so it's just a style issue which one is more 
correct.

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 defined InvalidXLogRecPtr as INT64_MAX rather than 0, we 
would still want those variables to be initialized to zero. As I said, I 
didn't check the code, but before we change those that ought to be checked.

- Heikki




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Etsuro Fujita
Дата:
Сообщение: Re: inherit support for foreign tables
Следующее
От: Dilip kumar
Дата:
Сообщение: Re: pg_basebackup vs. Windows and tablespaces