grouproll: missing fixed-box edges file refuses under generations_floor
While generations_floor is set, a declared fixed box with no edges file (floor_fixed_missing) is now also a generations refusal, never DR-4 only: its release and capabilities are unknown, and a box below the floor would take a generations lock as an ordinary HA lock (Fable branch review P2-3).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+34
−2
internal/grouproll/floor.go+10 −2internal/grouproll/floor_test.go+24 −0
diff --git a/internal/grouproll/floor.go b/internal/grouproll/floor.go| index 4b7da59a2..677a8506a 100644 |
| --- a/internal/grouproll/floor.go |
| +++ b/internal/grouproll/floor.go |
| @@ -59,7 +59,8 @@ const floorPopulation = "all-files-v1" |
| // the floor release is the first release that refuses a generations lock |
| // (slice 0, v0.39.0). A replace whose pinned template boots a release |
| // below it, a roll to a release below it, or any present edges file whose |
| -// capabilities lack replica-generations-1 (whatever the kind) refuses |
| +// capabilities lack replica-generations-1 (whatever the kind), or a |
| +// declared fixed box with no edges file (floor_fixed_missing), refuses |
| // with floor_generations, never DR-4: a box below it would take a |
| // generations lock as an ordinary HA lock and restore stale root data. |
| // So does a generations_floor without ha_floor, data_bucket and |
| @@ -133,10 +134,17 @@ func (e *Engine) Floor(ctx context.Context, kind, version string) (rule string, |
| } |
| } |
| // A declared fixed box with no file may still serve and |
| - // forward (its first PUT failed): DR-4, naming it. |
| + // forward (its first PUT failed): DR-4, naming it. While |
| + // generations_floor is set it is also a generations refusal: |
| + // with no file, its release and capabilities are unknown, and |
| + // a box below the floor would take a generations lock as an |
| + // ordinary HA lock. |
| for _, box := range e.c.FixedBoxes { |
| if !filed[box] { |
| reasons = append(reasons, Text("floor_fixed_missing", "box", box)) |
| + if generations { |
| + gens = append(gens, Text("floor_fixed_missing", "box", box)) |
| + } |
| } |
| } |
| if kind == "replace" { |
diff --git a/internal/grouproll/floor_test.go b/internal/grouproll/floor_test.go| index a2655926b..4d69370ee 100644 |
| --- a/internal/grouproll/floor_test.go |
| +++ b/internal/grouproll/floor_test.go |
| @@ -921,6 +921,30 @@ func TestFloorRefusesMemberWithoutGenerationsCapability(t *testing.T) { |
| } |
| } |
| +// A declared fixed box with no edges file is a generations refusal while |
| +// generations_floor is set (Fable branch review P2-3): its release and |
| +// capabilities are unknown, so it is refused, never DR-4 only. The DR-4 |
| +// reason stays among the row's reasons. |
| +func TestFloorGenerationsRefusesDeclaredFixedBoxWithoutAFile(t *testing.T) { |
| + for _, kind := range []string{"replace", "remove", "roll"} { |
| + t.Run(kind, func(t *testing.T) { |
| + h := newGenerationsHarness(t, false) |
| + h.c.FixedBoxes = []string{"adi", "tito"} |
| + h.f.c = h.c |
| + reason := Text("floor_fixed_missing", "box", "tito") |
| + r := h.floor(kind, "v0.39.0") |
| + h.generationsRefused(t, r, reason) |
| + if !containsValue(r.row(t, "floor-error")["reasons"], reason) { |
| + t.Fatalf("floor-error reasons = %v", r.row(t, "floor-error")["reasons"]) |
| + } |
| + }) |
| + } |
| + // Unset, the same box is DR-4 as before (TestFloorDeclaredFixedBoxWithoutAFile). |
| + h := newFloorHarness(t, false) |
| + h.c.FixedBoxes = []string{"adi", "tito"} |
| + h.refused(t, h.floor("replace", ""), Text("floor_fixed_missing", "box", "tito")) |
| +} |
| + |
| // Unset, the generations floor reads nothing new and records nothing: |
| // boxes without replica-generations-1 still drain. |
| func TestFloorGenerationsFloorUnset(t *testing.T) { |