I7 failed-record: the read of the registered failed records passes over a registration kept under a source. key; the whole test frees a failed record on registration-changed with a source-only registration present

Builds: design 47 H2 H-A-756, H-A-572 (2) (AC-I7c)
This commit is contained in:
2026-11-25 18:58:48 +01:00
parent 6fb40eac2f
commit 76212a0d4d
2 changed files with 14 additions and 11 deletions
@@ -767,17 +767,6 @@ func TestIndexerWhole(t *testing.T) {
Steps: []meshpipelinerunner.StepResult{{Step: meshpipelinerunner.StepResultStepUnit, Status: meshpipelinerunner.StepResultStatusRequired, Outcome: meshpipelinerunner.StepResultOutcomeCancelled}}}})
untilKey(t, ctx, pins, index.PinKey("main", r16), pinned("pipeline."+p16, failedRecord))
untilKey(t, ctx, pins, index.PinKey("main", r15), pinned("pipeline."+p16, failedRecord))
// AC-I7c: avahi leaves main's registrations: the record is freed from every pin.
reg, _ = json.Marshal(meshcatalog.Registration{V: 1, Module: "avahi", Origin: "novox/mesh-catalog", Path: "modules/avahi", Branches: []string{"beta", "gamma"}})
if _, err := regs.Put(ctx, index.RegistrationKey("avahi"), reg); err != nil {
t.Fatal(err)
}
if _, err := js.Publish(ctx, meshcatalog.SubjectRegistrationChanged, []byte(`{"module":"avahi"}`)); err != nil {
t.Fatal(err)
}
untilKey(t, ctx, pins, index.PinKey("main", r16), lacks(failedRecord))
untilKey(t, ctx, pins, index.PinKey("main", r15), lacks(failedRecord))
// Design 47 H2 §815: a source-only registration, kept under source.<owner>.<name>, watches its branch as any registration
// does, and a move of that branch by its repository, which holds no manifest, is taken in with no movers.
const hqCommit = "4444444444444444444444444444444444444444"
@@ -802,6 +791,17 @@ func TestIndexerWhole(t *testing.T) {
t.Errorf("the move of novox/hq on delta said %+v, want revision 2 with no movers", hq)
}
// AC-I7c, H-A-756: avahi leaves main's registrations while a source-only registration is kept: the record is freed from every pin.
reg, _ = json.Marshal(meshcatalog.Registration{V: 1, Module: "avahi", Origin: "novox/mesh-catalog", Path: "modules/avahi", Branches: []string{"beta", "gamma"}})
if _, err := regs.Put(ctx, index.RegistrationKey("avahi"), reg); err != nil {
t.Fatal(err)
}
if _, err := js.Publish(ctx, meshcatalog.SubjectRegistrationChanged, []byte(`{"module":"avahi"}`)); err != nil {
t.Fatal(err)
}
untilKey(t, ctx, pins, index.PinKey("main", r16), lacks(failedRecord))
untilKey(t, ctx, pins, index.PinKey("main", r15), lacks(failedRecord))
// Design 47 H2 H-A-708 (1), H-A-717 DQ-54: the start's phases are kept at start-phase of the state first-views, and the
// start's last phase ended is null.
untilKey(t, ctx, status, views.StartPhaseKey, func(v []byte) bool { return string(v) == "null" })
@@ -340,6 +340,9 @@ func (r *Registry) RegisteredFailedRecords(ctx context.Context) (map[string]bool
if !found || json.Unmarshal(v, &reg) != nil {
continue
}
if strings.HasPrefix(k, "source.") {
continue // a source-only registration builds and delivers nothing, so it holds no failed record (H-A-756)
}
if reg.Module == "" {
return nil, fmt.Errorf("the registration %s names no module, so no failed record is freed by this read", k)
}