diff --git a/seaweed-block/core/frontend/durable/provider_chunk_precopy_test.go b/seaweed-block/core/frontend/durable/provider_chunk_precopy_test.go index 510c3f43af..679241547d 100644 --- a/seaweed-block/core/frontend/durable/provider_chunk_precopy_test.go +++ b/seaweed-block/core/frontend/durable/provider_chunk_precopy_test.go @@ -243,8 +243,9 @@ func precopyBusyOwnerKeepsServing(t *testing.T, delay time.Duration) { resumedCount := 1 if err != nil { // Releasing the owner does not erase a slow sample. Admission must - // still refuse a measured final cut above its unchanged 1.2s allowance. - if !errors.Is(err, storage.ErrPrecopyNotConverged) || r.Precopy.Frozen || r.Precopy.Estimate <= 1200*time.Millisecond || (r.Precopy.Reason != "tail_too_large" && r.Precopy.Reason != "barrier_over_budget") { + // still refuse a tail-bound point; a small stalled tail can now declare + // the retained fixed-cost exception instead of recopying indefinitely. + if !errors.Is(err, storage.ErrPrecopyNotConverged) || r.Precopy.Frozen || r.Precopy.Estimate <= 1200*time.Millisecond || (r.Precopy.Reason != "tail_too_large" && r.Precopy.Reason != "barrier_over_budget" && r.Precopy.Reason != "fixed_cost_exceeds_freeze_budget") { t.Fatalf("post-release retry violated measured admission: report=%+v err=%v", r.Precopy, err) } if delay > 0 && r.Precopy.Fixed < delay { @@ -259,7 +260,9 @@ func precopyBusyOwnerKeepsServing(t *testing.T, delay time.Duration) { t.Fatalf("over-budget retry failed to resume service: n=%d err=%v", n, e) } } else if delay > 0 { - t.Fatal("retry froze despite a retained fixed sample above the allowance") + if !r.Precopy.Frozen || r.Precopy.Reason != "fixed_cost_over_allowance" || r.Precopy.Fixed < delay || r.Precopy.TailEstimate > 300*time.Millisecond || r.Precopy.PreviousEstimate <= 0 || r.Precopy.Estimate < r.Precopy.PreviousEstimate || r.Precopy.Estimate > 5*time.Second || r.Precopy.DeclaredFreeze != r.Precopy.Estimate { + t.Fatalf("slow retry bypassed the declared small-tail plateau rule: %+v", r.Precopy) + } } if started, resumed := k.calls(); len(started) != 2 || len(resumed) != resumedCount { t.Fatalf("retry hooks: started=%v resumed=%v", started, resumed) diff --git a/seaweed-block/docs/spec/README.md b/seaweed-block/docs/spec/README.md index 7b0862480e..254f474f92 100644 --- a/seaweed-block/docs/spec/README.md +++ b/seaweed-block/docs/spec/README.md @@ -334,3 +334,9 @@ one missing-probe/newer-ACK schedule. `R293_review_safe` checks four invariants; four negative controls separately remove retirement, the frame join, the readiness guard or ACK progress restoration. This abstracts successful admitted frames and does not prove physical-I/O, authority rollback or timing behavior. + +`PrecopyFixedAdmission.tla` checks bounded pre-copy cost admission: ordinary +allowance, small non-improving tail, declared freeze and the five-second ceiling. +`PrecopyFixedAdmission.cfg` is the positive configuration; `_no_tail`, `_no_stall` +and `_no_cap` must violate `SafeCommit`. It does not model publication/data safety +or physical latency; those remain separate checks.