| index a32a4705f..ee54ac62d 100644 |
| --- a/internal/sim/hostlife/regionha_test.go |
| +++ b/internal/sim/hostlife/regionha_test.go |
| @@ -690,20 +690,7 @@ func (w *world) relocReleasing(b *box, c *claim) { |
| } |
| return |
| } |
| - r := w.relocRelease(b, c) |
| - if r == nil { |
| - return |
| - } |
| - if w.cas(c, func(n *claim) bool { |
| - ok := sameOp(n.Op.ID, op.ID) && n.Op.Kind == "relocating" && n.Op.Phase == "releasing" && n.Op.Exec == b.ID && n.Op.Release == nil |
| - if ok { |
| - n.Op.Release = r |
| - } |
| - return ok |
| - }) { |
| - w.stats["release journaled: source"]++ |
| - w.logf("relocation %s: box %d released the host at TXID %d (flushed=%v)", op.ID, b.ID, r.FinalTX, r.Flushed) |
| - } |
| + w.relocJournalRelease(b, c, false) |
| return |
| } |
| if on("reloc-ack-before-pinning") && !acked(c) { |
| @@ -1247,19 +1234,7 @@ func (w *world) relocProbeFailed(b *box, c *claim) { |
| if b.ID != op.Exec { |
| return |
| } |
| - r := w.relocRelease(b, c) |
| - if r == nil { |
| - return |
| - } |
| - if w.cas(c, func(n *claim) bool { |
| - ok := sameOp(n.Op.ID, op.ID) && n.Op.Kind == "relocating" && n.Op.Phase == "probe-failed" && n.Op.Exec == b.ID && (n.Op.Release == nil || n.Op.Release.Box != b.ID) |
| - if ok { |
| - n.Op.Release = r |
| - } |
| - return ok |
| - }) { |
| - w.stats["release journaled: failed target"]++ |
| - } |
| + w.relocJournalRelease(b, c, false) |
| return |
| } |
| if on("reloc-replacement-cap") && op.Replacements >= maxReplacements { |
| @@ -2367,9 +2342,12 @@ func (w *world) preparedManifestHere(b *box, c *claim, gen string) bool { |
| // relocJournalRelease is the participant's release (1b-next Task 7): the |
| // live executor runs its release sequence and journals it |
| // (JournalRelease), the source in releasing, a failed target in |
| -// probe-failed. It is the release branch of relocReleasing and |
| -// relocProbeFailed, run by itself while a fence is pending (rev 8). |
| -func (w *world) relocJournalRelease(b *box, c *claim) { |
| +// probe-failed. relocReleasing and relocProbeFailed call it for their |
| +// release branch, and relocate calls it by itself while a fence is |
| +// pending (rev 8; pending marks the trace line). The CAS is the union of |
| +// the two phases' conditions: in releasing no release is journaled yet; |
| +// in probe-failed the journaled release, if any, is another box's. |
| +func (w *world) relocJournalRelease(b *box, c *claim, pending bool) { |
| op := c.Op |
| phase := op.Phase |
| r := w.relocRelease(b, c) |
| @@ -2388,6 +2366,10 @@ func (w *world) relocJournalRelease(b *box, c *claim) { |
| } else { |
| w.stats["release journaled: failed target"]++ |
| } |
| - w.logf("relocation %s: box %d released the host at TXID %d (flushed=%v), a fence pending", op.ID, b.ID, r.FinalTX, r.Flushed) |
| + note := "" |
| + if pending { |
| + note = ", a fence pending" |
| + } |
| + w.logf("relocation %s: box %d released the host at TXID %d (flushed=%v)%s", op.ID, b.ID, r.FinalTX, r.Flushed, note) |
| } |
| } |