Re: [BUG] standby node can not provide service even it replays alllog files

Поиск
Список
Период
Сортировка
От Kyotaro Horiguchi
Тема Re: [BUG] standby node can not provide service even it replays alllog files
Дата
Msg-id 20191023.125119.271090295084256939.horikyota.ntt@gmail.com
обсуждение исходный текст
Ответ на Re:Re: [BUG] standby node can not provide service even it replaysall log files  (Thunder <thunder1@126.com>)
Ответы Re: [BUG] standby node can not provide service even it replays alllog files  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Re:Re: [BUG] standby node can not provide service even it replaysall log files  (Thunder <thunder1@126.com>)
Список pgsql-hackers
Hello.

At Tue, 22 Oct 2019 20:42:21 +0800 (CST), Thunder  <thunder1@126.com> wrote in 
> Update the patch.
> 
> 1. The STANDBY_SNAPSHOT_PENDING state is set when we replay the first XLOG_RUNNING_XACTS and the sub transaction ids
areoverflow.
 
> 2. When we log XLOG_RUNNING_XACTS in master node, can we assume that all xact IDS < oldestRunningXid are considered
finished?

Unfortunately we can't. Standby needs to know that the *standby's*
oldest active xid exceeds the pendig xmin, not master's. And it is
already processed in ProcArrayApplyRecoveryInfo. We cannot assume that
the oldest xids are not same on the both side in a replication pair.

> 3. If we can assume this, when we replay XLOG_RUNNING_XACTS and change standbyState to STANDBY_SNAPSHOT_PENDING, can
werecord oldestRunningXid to a shared variable, like procArray->oldest_running_xid?
 
> 4. In standby node when call GetSnapshotData if procArray->oldest_running_xid is valid, can we set xmin to be
procArray->oldest_running_xid?
> 
> Appreciate any suggestion to this issue.

At 2019-10-22 01:27:58, "Robert Haas" <robertmhaas@gmail.com> wrote:
>On Mon, Oct 21, 2019 at 4:13 AM Thunder <thunder1@126.com> wrote:
..
> >I think that the issue you've encountered is design behavior.  In
> >other words, it's intended to work that way.
> >
> >The comments for the code you propose to change say that we can allow
> >connections once we've got a valid snapshot. So presumably the effect
> >of your change would be to allow connections even though we don't have
> >a valid snapshot.
> >
> >That seems bad.

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Remove obsolete options for createuser
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: [PATCH] Do not use StdRdOptions in Access Methods