Re: PG13 fails to startup even though the current transaction is equal to the target transaction

Поиск
Список
Период
Сортировка
От Fujii Masao
Тема Re: PG13 fails to startup even though the current transaction is equal to the target transaction
Дата
Msg-id 86e9abcd-a902-de62-344e-5c4336b61b58@oss.nttdata.com
обсуждение исходный текст
Ответ на Re: PG13 fails to startup even though the current transaction is equal to the target transaction  (Sean Jezewski <sjezewski@salesforce.com>)
Список pgsql-hackers

On 2021/03/22 21:40, Sean Jezewski wrote:
> Hi Kyotaro -
> 
> Thanks for the response.
> 
> I think it boils down to your comment:
> 
>  > I'm not sure.  The direct cause of the "issue" is a promotion trigger
>  > that came before reaching recovery target.  That won't happen if the
>  > "someone" doesn't do that.
> 
> I think the question is 'under what conditions is it safe to do the promotion' ?
> 
> What is your recommendation in this case? The end of the archive has been reached. All transactions have been
replayed.And in fact the current transaction id is exactly equal to the target recovery transaction id.
 

I guess that the transaction with this current XID has not been committed
yet at that moment. Right? I thought that because you confirmed the XID
by SELECT pg_catalog.txid_snapshot_xmax(pg_catalog.txid_current_snapshot()).
IIUC this query doesn't return the XID of already-committed transaction.

The standby thinks that the recovery reaches the recovery target when
the XID of *committed* transaction get equal to the recovery_target_xid.
So in your case, the standby didn't reached the recovery target when you
requested the promotion. IMO this is why you got that FATAL error.

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION



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

Предыдущее
От: Fabrízio de Royes Mello
Дата:
Сообщение: Re: Minimal logical decoding on standbys
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] Custom compression methods