From 76212a0d4df757df7a141f4c4b6d6dec29ded998 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 18:58:48 +0100 Subject: [PATCH] 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) --- .../takein_integration_test.go | 22 +++++++++---------- .../internal/index/pins.go | 3 +++ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/takein_integration_test.go b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/takein_integration_test.go index e1f33c7d3..1a3aaf622 100644 --- a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/takein_integration_test.go +++ b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/takein_integration_test.go @@ -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.., 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" }) diff --git a/modules/mesh-delivery-indexer/internal/index/pins.go b/modules/mesh-delivery-indexer/internal/index/pins.go index c10ba1999..da3cd18d8 100644 --- a/modules/mesh-delivery-indexer/internal/index/pins.go +++ b/modules/mesh-delivery-indexer/internal/index/pins.go @@ -340,6 +340,9 @@ func (r *Registry) RegisteredFailedRecords(ctx context.Context) (map[string]bool if !found || json.Unmarshal(v, ®) != 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) }