Commit 8d13230
authored
Unrolling saga actions for external IPs and NICs (#1474)
* Unrolling saga actions for external IPs and NICs
Previously, for NICs and external IPs, the saga action that actually
created the records and the corresponding undo were not together in a
saga node. The undo was associated with a preceding action that created
UUIDs for the records. That was because each action may have created
multiple records, where the count was not known when we create the saga
template, and so the forward action performed multiple fallible steps.
To unwind it completely, including reverting the creation of N
resources, in the case where the N + 1th failed, we put the undo in the
preceding step. That worked, but was certainly confusing and bad for
maintenance, since the action and its undo were in different nodes. It
also resulted in a ton of extra complexity in some of the downstream
queries, which now had to be aware of the fact that we might replay a
partially-played saga node. This commit undoes all that.
- Unroll the instance external IP address query
- Unroll the network interface creation query
- Actually delete NICs when we delete the instance, and add test for
that
- Simplify network interface query. An additional CTE detecting the
partial-saga replay case is no longer needed, since we don't run the
saga that way.
* Review feedback
- Create UUIDs in separate saga actions for NICs and external IPs
- Remove remaining cruft from NIC-creation query that was required to
handle the previous saga implementation.1 parent 604a35b commit 8d13230
File tree
7 files changed
+407
-650
lines changed- nexus
- src
- app
- sagas
- db
- datastore
- queries
- tests/integration_tests
7 files changed
+407
-650
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
62 | 95 | | |
63 | 96 | | |
64 | 97 | | |
| |||
217 | 250 | | |
218 | 251 | | |
219 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
220 | 256 | | |
221 | 257 | | |
222 | 258 | | |
| |||
502 | 538 | | |
503 | 539 | | |
504 | 540 | | |
505 | | - | |
| 541 | + | |
506 | 542 | | |
507 | 543 | | |
508 | 544 | | |
509 | | - | |
510 | | - | |
| 545 | + | |
| 546 | + | |
511 | 547 | | |
512 | 548 | | |
513 | 549 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | | - | |
58 | | - | |
| 57 | + | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
0 commit comments