Re: Sync Rep v19

Поиск
Список
Период
Сортировка
От Fujii Masao
Тема Re: Sync Rep v19
Дата
Msg-id AANLkTi=WTHOvL2PtS=2U_eW4GxoM82VDOBWk-255fxQk@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Sync Rep v19  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Sync Rep v19  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Fri, Mar 11, 2011 at 10:02 PM, Robert Haas <robertmhaas@gmail.com> wrote:
>> How about sending the timestamp of last applied transaction
>> (i.e., this is the return value of pg_last_xact_replay_timestamp)
>> from the standby to the master, and reporting it in
>> pg_stat_replication? Then you can see the lag by comparing
>> it with current_timestamp.
>>
>> But since the last replay timestamp doesn't advance (but
>> current timestamp advances) if there is no work on the master,
>> the calculated lag might be unexpectedly too large. So, to
>> calculate the exact lag, I'm thinking that we should introduce
>> new function which returns the timestamp of the last transaction
>> written in the master.
>>
>> Thought?
>
> Hmm... where would we get that value from?

xl_xact_commit->xact_time (which is set in RecordTransactionCommit)
and xl_xact_abort->xact_time (which is set in RecordTransactionAbort).

> And what if no
> transactions are running on the master?

In that case, the last write WAL timestamp would become equal to the
last replay WAL timestamp. So we can see that there is no lag.

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Replication server timeout patch
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Typed-tables patch broke pg_upgrade