Commit 0d43e43
authored
[DPE-10663] fix(patroni): handle unreachable cluster in get_member_status (#179)
* fix(patroni): handle unreachable cluster in get_member_status
get_member_status() called cluster_status() with no try/except, unlike
its siblings get_member_ip / get_primary / cluster_members which all
catch the RetryError cluster_status() raises when no Patroni endpoint
responds. The exception then propagated uncaught into callers.
During a PITR restore, Patroni is intentionally stopped while the
restore runs; the ops framework re-emits the deferred
database-peers-relation-changed event inside the restore action hook,
which calls _was_restore_successful() -> get_member_status() ->
cluster_status(), raising RetryError. That crashed the restore action
hook with a non-zero exit, discarding the staged restore-status result
and exhausting the integration test's 10x retry loop
(test_backups_pitr_{aws,gcp}).
Catch the RetryError and return "" — the value the method's docstring
already promises when the status cannot be retrieved — so callers see
a clean early-exit instead of a hook crash. This fixes every caller of
get_member_status, not just the restore path.
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
* chore: bump version to 16.3.4
The get_member_status RetryError fix is a behavioral change to the
library, so it needs its own release. 16.3.3 is already released, so
bump to 16.3.4 for the fix to ship under a new version.
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
---------
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>1 parent 4b70835 commit 0d43e43
4 files changed
Lines changed: 47 additions & 3 deletions
File tree
- single_kernel_postgresql/managers
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
255 | 259 | | |
256 | 260 | | |
257 | 261 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
108 | 148 | | |
109 | 149 | | |
110 | 150 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments