Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/multisite.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ An example configuration for two Patroni sites:
- 10.0.0.1:2379
host: 10.0.1.1,10.0.1.2,10.0.1.3 # How the leader of the other site(s) can connect to the primary on this site
port: 5432
primary_slot_name: dr
# Multisite failover timeouts
ttl: 90
retry_timeout: 40
Expand All @@ -130,6 +131,8 @@ Details of the configuration parameters
Comma-separated list of IPs of the Patroni nodes that can become a primary on the present site
``port``
Postgres port, through which other sites' members can connect to this site. It can be specified once if all nodes use the same port, or as a comma-separated list matching the different port numbers, in the order used in the ``host`` key.
``primary_slot_name``
Optional name of the physical slot used to retain WAL for site failovers. If in use, the slot has to be defined in the dynamic configuration.
``ttl``
Time to live of site leader lock. If the site is unable to elect a functioning leader within this timeout, a different site can take over the leader role. Must be a few times longer than the usual ``ttl`` value in order to prevent unnecessary site failovers.
``retry_timeout``
Expand Down
4 changes: 4 additions & 0 deletions patroni/multisite.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ def _set_standby_config(self, other: Member):
'port': other.data['port'],
'create_replica_methods': ['basebackup'],
'leader_site': other.name,
'primary_slot_name': other.data.get('primary_slot_name'),
}
except KeyError:
old_conf = self._standby_config
Expand Down Expand Up @@ -384,6 +385,9 @@ def touch_member(self):
'host': self.config['host'],
'port': self.config['port'],
}
if self.config['primary_slot_name']:
data['primary_slot_name'] = self.config['primary_slot_name']

logger.info(f"Touching member {self.name} with {data!r}")
self.dcs.touch_member(data)

Expand Down
Loading