sorintlab / stolon

PostgreSQL cloud native High Availability and more.
https://talk.stolon.io
Apache License 2.0
4.62k stars 443 forks source link

Can we change Sync_Priority value for a standby ? #895

Open nijesh8 opened 1 year ago

nijesh8 commented 1 year ago

Can we change the SYNC_PRIORITY value for a particular Synchronous standby in Stolon Keeper nodes ? This is to choose 1 or 2 specific standbys as Failover targets, and keeping the remaining as less priority standbys.

  synchronous_standby_names

2 (stolon_b7c46a93,stolon_ff7d06b7) (1 row)

application_name | client_addr | client_hostname | state | sync_state | sync_priority ------------------+---------------+-----------------+-----------+------------+--------------- stolon_ff7d06b7 | 10.xx.xx.19 | | streaming | sync | 2 stolon_b7c46a93 | 10.xx.xx.8 | | streaming | sync | 1 stolon_14cf1afd | 10.xx.xx.39 | | streaming | async | 0 (3 rows)

viggy28 commented 1 year ago

Though we don't have a priority value, stolon-keeper command has a flag --can-be-synchronous-replica to convey whether a replica will be considered as synchronous replica or not (and there is also --can-be-master flag)