You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To retrieve the primary replica, one can use the action `get-primary` on any of the units running ` postgresql`:
20
+
### Primary vs. leader unit
21
+
22
+
The [PostgreSQL primary server](https://www.postgresql.org/docs/current/runtime-config-replication.html#RUNTIME-CONFIG-REPLICATION-PRIMARY) unit may or may not be the same as the [juju leader unit](https://juju.is/docs/juju/leader).
23
+
24
+
The juju leader unit is the represented in `juju status` by an asterisk (*) next to its name.
25
+
26
+
To retrieve the juju unit that corresponds to the PostgreSQL primary, use the action `get-primary` on any of the units running ` postgresql`:
21
27
```shell
22
28
juju run postgresql/leader get-primary
23
29
```
24
-
25
30
Similarly, the primary replica is displayed as a status message in `juju status`. However, one should note that this hook gets called on regular time intervals and the primary may be outdated if the status hook has not been called recently.
26
31
27
-
### `update-status` hook
28
-
29
-
**We highly suggest configuring the status hook to run frequently.** In addition to reporting the primary, secondaries, and other statuses, the status hook performs self-healing in the case of a network cut.
32
+
[note]
33
+
**We highly suggest configuring the `update-status` hook to run frequently.** In addition to reporting the primary, secondaries, and other statuses, the [status hook](https://juju.is/docs/sdk/update-status-event) performs self-healing in the case of a network cut.
30
34
31
35
To change the frequency of the `update-status` hook, run
Note that this hook executes a read query to PostgreSQL. On a production level server, this should be configured to occur at a frequency that doesn't overload the server with read requests. Similarly, the hook should not be configured at too quick of a frequency, as this can delay other hooks from running.
36
-
37
-
You can read more about status hooks [here](https://juju.is/docs/sdk/update-status-event).
39
+
<!--Note that this hook executes a read query to PostgreSQL. On a production level server, this should be configured to occur at a frequency that doesn't overload the server with read requests. Similarly, the hook should not be configured at too quick of a frequency, as this can delay other hooks from running. -->
0 commit comments