Clear logical slot's 'synced' flag on promotion of standby
От | shveta malik |
---|---|
Тема | Clear logical slot's 'synced' flag on promotion of standby |
Дата | |
Msg-id | CAJpy0uBJqTQdq+UDW55oK2bhxMig=FaEYFV=+ZaKmtmgNWwsHw@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: Clear logical slot's 'synced' flag on promotion of standby
Re: Clear logical slot's 'synced' flag on promotion of standby |
Список | pgsql-hackers |
Hi, This is a spin-off thread from [1]. Currently, in the slot-sync worker, we have an error scenario [2] where, during slot synchronization, if we detect a slot with the same name and its synced flag is set to false, we emit an error. The rationale is to avoid potentially overwriting a user-created slot. But while analyzing [1], we observed that this error can lead to inconsistent behavior during switchovers. On the first switchover, the new standby logs an error: "Exiting from slot synchronization because a slot with the same name already exists on the standby." But during a double switchover, this error does not occur. Upon re-evaluating this, it seems more appropriate to clear the synced flag after promotion, as the flag does not hold any meaning on the primary. Doing so would ensure consistent behavior across all switchovers, as the same error will be raised avoiding the risk of overwriting user's slots. A patch can be posted soon on the same idea. [1]: https://www.postgresql.org/message-id/CAJpy0uCZ-Z9Km-fGjXm9C90DoiF_EFe2SbCh9Aw7vnF-9K%2BJ_A%40mail.gmail.com [2]: /* User-created slot with the same name exists, raise ERROR. */ if (!synced) ereport(ERROR, errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), errmsg("exiting from slot synchronization because same" " name slot \"%s\" already exists on the standby", remote_slot->name)); thanks Shveta
В списке pgsql-hackers по дате отправления: