Skip to content

Commit 0cdc7b9

Browse files
authored
[2/n] [reconfigurator] check for stale inventory in mupdate override set path (#10409)
This fixes a bug similar to #10391: a planner running against a stale inventory collection that still shows a mupdate override (because that inventory was captured before the sled cleared the marker) would trigger `BpSetOverride` again, and undo RFD 556 state machine advancement that that a more recent plan had already completed.
1 parent fa779b2 commit 0cdc7b9

6 files changed

Lines changed: 717 additions & 10 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This test exercises stale inventory with `BpSetOverride`.
2+
#
3+
# After the planner has cleared the "will remove mupdate override" field on a
4+
# sled, it should not set that field again if a subsequent planner run is
5+
# performed against a stale inventory that still has the override visible.
6+
7+
load-example --nsleds 1 --ndisks-per-sled 3
8+
sled-list
9+
10+
# Create a TUF repository, set as target release, and update the install dataset.
11+
tuf-assemble ../../update-common/manifests/fake.toml
12+
set target-release repo-1.0.0.zip
13+
sled-update-install-dataset serial0 --to-target-release
14+
15+
# Simulate a mupdate on serial0.
16+
sled-set serial0 mupdate-override 11111111-1111-1111-1111-111111111111
17+
18+
# Generate an inventory that captures the post-MUPdate state (mupdate override
19+
# visible, sled-agent generation still 2). We'll come back to plan against
20+
# this collection later, by which time it will be stale.
21+
inventory-generate
22+
inventory-list
23+
24+
# First plan: sets remove_mupdate_override on serial0 and bumps the target
25+
# release minimum generation.
26+
blueprint-plan latest latest
27+
blueprint-diff latest
28+
29+
# Simulate the sled processing the recovery blueprint: it clears the
30+
# override marker AND advances its reconciled config generation.
31+
sled-set serial0 mupdate-override unset
32+
sled-set serial0 omicron-config latest
33+
34+
# Generate a fresh inventory. This inventory would not have a mupdate override,
35+
# and would advance the sled agent generation.
36+
inventory-generate
37+
38+
# This planner run clears the "will remove mupdate override" field and
39+
# noop-convert zones to Artifact image sources.
40+
blueprint-plan latest latest
41+
blueprint-diff latest
42+
43+
# Now plan against the stale inventory from earlier. The expected behavior
44+
# is that the planner detects inventory staleness on the BpSetOverride path and
45+
# does nothing. As a result, the blueprint diff should be empty.
46+
blueprint-plan latest eb0796d5-ab8a-4f7b-a884-b4aeacb8ab51
47+
blueprint-diff latest

dev-tools/reconfigurator-cli/tests/output/cmds-mupdate-stale-inventory-set-stderr

Whitespace-only changes.

0 commit comments

Comments
 (0)