node-engine: at a start a hold for differing parts or a missing entry is judged again, not kept as a failed backup waiting for an answer (§524, §421, ADR 0568 §4)

This commit is contained in:
2026-11-16 01:04:07 +01:00
parent 5a3510b115
commit c025bb5f1e
3 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -1530,7 +1530,7 @@ func (a *Agent) baseline(ctx context.Context, module string, w wantNow, comp com
a.mu.Unlock()
return false
}
if h.Phase == string(nodeengineclient.PhaseHeld) {
if h.Phase == string(nodeengineclient.PhaseHeld) && !judgedAgain(h.Detail) {
// Held for a failed backup, and the operator's answer is still to come: the hold is kept, nothing is
// backed up again or applied, and the next revision of the want is the answer (ADR 0568 §4). Said, so
// why it holds is read from the journal and not guessed (issue 1585: this branch was silent).
+4
View File
@@ -834,6 +834,10 @@ func TestADataModuleIsBackedUpFirstAndHeldWhenItFails(t *testing.T) {
{"restic: the repository is locked", meshwants.WantsByWantNodeModuleValueBackupAgain, 1, 1, nodeengineclient.PhaseRunning, false},
{"restic: the repository is locked", meshwants.WantsByWantNodeModuleValueBackupSkip, 0, 1, nodeengineclient.PhaseRunning, false},
{"restic: the repository is locked", "", 0, 0, nodeengineclient.PhaseHeld, false},
// A hold the node-engine judges again (novox's indexer, 2026-11-16): its parts differed or its entry was not
// held, which no answer of the operator's releases; at a start it is judged again, here backed up and applied.
{PartsDiffer + " fetched and not in the want's parts: sha256:a03131c6", "", 1, 1, nodeengineclient.PhaseRunning, false},
{EntryMissing + " the catalog half holds no entry of the build", "", 1, 1, nodeengineclient.PhaseRunning, false},
} {
r := newBed(t)
r.comps.before(ck1, craw1)
+8
View File
@@ -22,6 +22,14 @@ const (
EntryMissing = "entry-missing:"
)
// judgedAgain says a held have's detail is a hold the node-engine judges again at a start, not one that waits for the
// operator's answer: its want's parts differ from its composition (§524) or its entry is not held (§421). Only a failed
// backup or restore point waits for an answer (ADR 0568 §4); novox, 2026-11-16: the indexer held "parts-differ" was kept
// at a start as "held for a failed backup", waiting for an answer nobody was asked.
func judgedAgain(why string) bool {
return strings.HasPrefix(why, PartsDiffer) || heldForEntry(why)
}
// heldForEntry says whether why is a hold for the entry a want names.
func heldForEntry(why string) bool {
return strings.HasPrefix(why, EntryAsked) || strings.HasPrefix(why, EntryMissing)