Merge pull request 'The assigner, grants and the indexer ask their views again when the bus makes their consumer after a first view (issue 1966, recovery)' (#184) from fix/1966-views-durable into main

This commit was merged in pull request #184.
This commit is contained in:
2026-11-09 07:04:31 +00:00
3 changed files with 14 additions and 0 deletions
@@ -200,6 +200,12 @@ func (iv *indexerViews) start(ctx context.Context, w *world, wake func(), settle
} }
}) })
} }
// The hub says when the bus made its consumer: a picture asked before then is asked again (views.Follower.ConsumerMade).
iv.hub.OnBound(func(created time.Time) {
for _, f := range all {
f.ConsumerMade(ctx, created)
}
})
// Not heard, the indexer's views family is the finding family-not-heard until it binds (ADR 0615 §5): the handler is // Not heard, the indexer's views family is the finding family-not-heard until it binds (ADR 0615 §5): the handler is
// registered on the module's hub, which the assigner starts once every handler is. // registered on the module's hub, which the assigner starts once every handler is.
_ = notHeardWriter(iv.findings, iv.logf).Bind(process.EventsStream, "the indexer's manifests, modules and graph are the first views' alone until the assigner starts again", func() error { _ = notHeardWriter(iv.findings, iv.logf).Bind(process.EventsStream, "the indexer's manifests, modules and graph are the first views' alone until the assigner starts again", func() error {
@@ -166,6 +166,8 @@ func followAssignments(ctx context.Context, hub *process.EventHub, cred process.
}() }()
// The assigner's views family, on the module's one hub (the host starts it once every handler is registered); a family the // The assigner's views family, on the module's one hub (the host starts it once every handler is registered); a family the
// hub cannot register is the finding family-not-heard until the indexer starts again (ADR 0615 §5). // hub cannot register is the finding family-not-heard until the indexer starts again (ADR 0615 §5).
// The hub says when the bus made its consumer: a picture asked before then is asked again (views.Follower.ConsumerMade).
hub.OnBound(func(created time.Time) { f.ConsumerMade(ctx, created) })
_ = notHeardWriter(ctx, findings, logf).Bind(process.EventsStream, "the assignments is the first view's alone, asked again by hand, until the indexer starts again", func() error { _ = notHeardWriter(ctx, findings, logf).Bind(process.EventsStream, "the assignments is the first view's alone, asked again by hand, until the indexer starts again", func() error {
return hub.Handle("mesh.mod."+index.AssignerModule+".event."+views.EventPrefix+"*", views.Hear(ctx, map[string]*views.Follower{index.AssignmentsState: f}, logf)) return hub.Handle("mesh.mod."+index.AssignerModule+".event."+views.EventPrefix+"*", views.Hear(ctx, map[string]*views.Follower{index.AssignmentsState: f}, logf))
}) })
@@ -158,6 +158,12 @@ func run(ctx context.Context, getenv func(string) string, logOut io.Writer) erro
if !registered { if !registered {
registered = true registered = true
// An owner's views event goes to the follower of its state, which acknowledges it (firstviews.go). // An owner's views event goes to the follower of its state, which acknowledges it (firstviews.go).
// The hub says when the bus made its consumer: a picture asked before then is asked again (views.Follower.ConsumerMade).
hub.OnBound(func(created time.Time) {
for _, f := range byState {
f.ConsumerMade(ctx, created)
}
})
if err := hub.Handle(views.EventsPattern, hearViews); err != nil { if err := hub.Handle(views.EventsPattern, hearViews); err != nil {
return err return err
} }