Re: Change pg_last_xlog_receive_location not to move backwards

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: Change pg_last_xlog_receive_location not to move backwards
Дата
Msg-id 20110211165256.GO4116@tamriel.snowman.net
обсуждение исходный текст
Ответ на Re: Change pg_last_xlog_receive_location not to move backwards  (Fujii Masao <masao.fujii@gmail.com>)
Ответы Re: Change pg_last_xlog_receive_location not to move backwards  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Fujii, all,

* Fujii Masao (masao.fujii@gmail.com) wrote:
> That logic exists because we'd like to check that newly-received WAL
> data is consistent with previous one by validating the header of new
> WAL file. So since we need the header of new WAL file, we retreat the
> replication starting location to the beginning of the WAL file when
> reconnecting to the primary.

Thanks for that explanation, but I can't help but wonder why it doesn't
make more sense to introduce a new variable to track the value you want
rather than reusing an existing one and then adding a variable to
represent what the old variable was already doing.  In other words, why
not invent

XLogRecPtr        newestReceviedUpto; /* or something */

and update that as necessary and have the function you want changed
return that, and leave receivedUpto alone..?  It seems like it'd be a
lot easier to prove to ourselves that your patch didn't break anything,
presuming the function we're talking about changing the return value of
isn't called anywhere (seems rather unlikely to me..).

Also, you really should reformat the docs properly when you change them,
rather than leaving the lines ragged..
Thanks,
    Stephen

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Add support for logging the current role
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Add support for logging the current role