Commit 29b0f7e
authored
[DPE-10370] fix(backups): reject standby backup actions and harden async replication (#1587)
* fix(backups): reject standby backup actions and harden async replication
Fail create-backup, list-backups, and restore on standby clusters with
explicit guidance to run those actions on the primary cluster.
Also guard async replication relation handling when no remote units are
present yet, preventing uncaught StopIteration during create-replication.
Add unit coverage for both fixes, add a Juju3 Ceph-backed integration test
for async replication backup behavior, and switch microceph TLS setup to a
non-loopback host IP.
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
* test(integration): simplify action assertions for Juju 3
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
* fix(async-replication): correct re-emission of relation-changed event
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
* test(unit): fix async replication mocks
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
* test(integration): migrate async replication backup test to jubilant
Re-implement the standby-backup integration test on jubilant under the
high_availability/ package, mirroring the jubilant implementation from
- Replace ha_tests/test_async_replication_backups_ceph.py with a
jubilant version under high_availability/, plus the package __init__
- Add high_availability_helpers_new.py with leader/units/primary
lookups and wait_for_apps_status
- Add a jubilant `juju` fixture to the integration conftest and depend
on jubilant ^1.8.0
- Point the spread task at the new module path and drop the -juju29
variant
- Use REPLICATION_CONSUMER_RELATION/REPLICATION_OFFER_RELATION constants
in _is_standby_cluster instead of "replication"/"replication-offer"
- Reword async replication action failures from "pod" to "unit"
addresses and update the matching unit test
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
* test(integration): fix async replication ceph backup test
Get test_standby_backup_rejected_with_clear_message running green
against real Juju + Ceph:
- Pass the s3-integrator config at deploy time and wait for the app to
reach blocked status (10m) before syncing credentials, instead of
configuring it separately while the unit is still provisioning
- Run create-backup on the primary unit: without TLS the charm only
permits backups on the primary, and this test does not enable TLS
(drop the now-unused get_app_units import)
- Give the second_model fixture its own Juju() instance so it stops
reassigning the shared temp-model's model name, which broke
jubilant.temp_model teardown and leaked the model
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
* test(integration): exclude async replication backup test from Juju 2.9
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
---------
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>1 parent 17c6449 commit 29b0f7e
11 files changed
Lines changed: 529 additions & 22 deletions
File tree
- src
- relations
- tests
- integration
- high_availability
- spread/test_async_replication_backups_ceph.py
- unit
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
63 | 76 | | |
64 | 77 | | |
65 | 78 | | |
| |||
153 | 166 | | |
154 | 167 | | |
155 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
156 | 172 | | |
157 | 173 | | |
158 | 174 | | |
| |||
183 | 199 | | |
184 | 200 | | |
185 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
186 | 212 | | |
187 | 213 | | |
188 | 214 | | |
| |||
1060 | 1086 | | |
1061 | 1087 | | |
1062 | 1088 | | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
1063 | 1094 | | |
1064 | 1095 | | |
1065 | 1096 | | |
| |||
1239 | 1270 | | |
1240 | 1271 | | |
1241 | 1272 | | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
1242 | 1278 | | |
1243 | 1279 | | |
1244 | 1280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
437 | 440 | | |
438 | | - | |
439 | | - | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
440 | 451 | | |
441 | | - | |
| 452 | + | |
442 | 453 | | |
443 | 454 | | |
444 | | - | |
| 455 | + | |
445 | 456 | | |
446 | 457 | | |
447 | 458 | | |
| |||
648 | 659 | | |
649 | 660 | | |
650 | 661 | | |
651 | | - | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
657 | 676 | | |
658 | 677 | | |
659 | 678 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
24 | 35 | | |
25 | 36 | | |
26 | 37 | | |
| |||
101 | 112 | | |
102 | 113 | | |
103 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
104 | 129 | | |
105 | 130 | | |
106 | 131 | | |
| |||
151 | 176 | | |
152 | 177 | | |
153 | 178 | | |
154 | | - | |
| 179 | + | |
155 | 180 | | |
156 | 181 | | |
157 | 182 | | |
| |||
209 | 234 | | |
210 | 235 | | |
211 | 236 | | |
212 | | - | |
| 237 | + | |
213 | 238 | | |
214 | 239 | | |
215 | 240 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
Lines changed: 50 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
0 commit comments