From 4f7e211adce72febc45289bced81ee036d2ca125 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Tue, 1 Dec 2026 09:45:24 -0800 Subject: [PATCH] hostlimit, storage: a hold is a no-progress window renewed by its work - hostlimit: Config.MaxHold (a fixed 5-minute hold limit) becomes NoProgress (default 60 s). Progress(id) records the work's progress, with no OS call; the hold's one timer, when it fires, arms again for the rest of the window if the work progressed, and revokes otherwise. A hold whose work keeps progressing is never revoked; a stalled one is revoked within the window. - blockvolume: --host-limit-no-progress; --host-limit-max-hold stays as a deprecated alias of it. - storage: BudgetProgress, the optional Budget that renews a hold; a cut attempt reports one unit of work per chunk compared, staged or uploaded. A hydrate-all holds one permit per chunk fill, so its hold is one fetch. - invariants: INV-HOST-HOLD-NO-PROGRESS-001; M7 states the rule. Co-Authored-By: Claude Opus 5.5 --- seaweed-block/cmd/blockvolume/host_limit.go | 3 +- seaweed-block/core/hostlimit/limiter.go | 46 ++++++++++++++++--- seaweed-block/core/hostlimit/limiter_test.go | 2 +- .../core/storage/chunk_cut_budget.go | 14 +++++- .../core/storage/chunk_cut_observation.go | 14 +++++- .../core/storage/chunk_cut_payload.go | 4 ++ .../storage/chunk_cut_revoke_reuse_test.go | 6 +-- seaweed-block/core/storage/chunk_layer.go | 2 + seaweed-block/docs/design/invariants.md | 5 +- 9 files changed, 78 insertions(+), 18 deletions(-) diff --git a/seaweed-block/cmd/blockvolume/host_limit.go b/seaweed-block/cmd/blockvolume/host_limit.go index f2d94d7aa0..fbb79fa4a8 100644 --- a/seaweed-block/cmd/blockvolume/host_limit.go +++ b/seaweed-block/cmd/blockvolume/host_limit.go @@ -16,5 +16,6 @@ func registerHostLimitFlags(fs *flag.FlagSet, c *hostlimit.Config) { fs.Int64Var(&c.COWBytes, "host-limit-cow-bytes", c.COWBytes, "maximum saved COW bytes per slot") fs.Int64Var(&c.BytesPerSecond, "host-limit-upload-bytes-sec", c.BytesPerSecond, "pacing parameter divided per process by cut-slot count; not a host rate cap") fs.IntVar(&c.FallbackVolumes, "host-limit-fallback-volumes", c.FallbackVolumes, "kept for configuration compatibility; the urgent fallback is not paced (no shared host cap to protect)") - fs.DurationVar(&c.MaxHold, "host-limit-max-hold", c.MaxHold, "cut lease timeout; expiration aborts but waits for admitted I/O before release") + fs.DurationVar(&c.NoProgress, "host-limit-no-progress", c.NoProgress, "a held slot is revoked after this long with no progress of its work (chunks compared, staged, uploaded or filled); revocation aborts but waits for admitted I/O before release") + fs.DurationVar(&c.NoProgress, "host-limit-max-hold", c.NoProgress, "deprecated: the same as --host-limit-no-progress (a hold is no longer limited by its age)") } diff --git a/seaweed-block/core/hostlimit/limiter.go b/seaweed-block/core/hostlimit/limiter.go index 754e8189e3..1ec81dc98d 100644 --- a/seaweed-block/core/hostlimit/limiter.go +++ b/seaweed-block/core/hostlimit/limiter.go @@ -14,6 +14,7 @@ import ( "os" "path/filepath" "sync" + "sync/atomic" "time" ) @@ -58,16 +59,17 @@ type Config struct { PayloadBytes, COWBytes int64 BytesPerSecond int64 FallbackVolumes int - MaxHold time.Duration - // NoProgress is the hold's no-progress window (seam). + // NoProgress is a hold's no-progress window: a held slot is revoked + // only after this long with no progress of its work (Progress). Work + // that keeps progressing is never revoked, however long it holds. NoProgress time.Duration } func DefaultConfig(dir string) Config { - return Config{Directory: dir, NormalSlots: 3, UrgentSlots: 1, FillSlots: 2, IdleSlots: 1, PayloadBytes: 64 << 20, COWBytes: 1 << 30, BytesPerSecond: 64 << 20, FallbackVolumes: 200, MaxHold: 5 * time.Minute, NoProgress: 60 * time.Second} + return Config{Directory: dir, NormalSlots: 3, UrgentSlots: 1, FillSlots: 2, IdleSlots: 1, PayloadBytes: 64 << 20, COWBytes: 1 << 30, BytesPerSecond: 64 << 20, FallbackVolumes: 200, NoProgress: 60 * time.Second} } func (c Config) Validate() error { - if !filepath.IsAbs(c.Directory) || c.NormalSlots < 1 || c.NormalSlots > 256 || c.UrgentSlots < 1 || c.UrgentSlots > 256 || c.FillSlots < 0 || c.FillSlots > 256 || c.IdleSlots < 0 || c.IdleSlots > 256 || c.NormalSlots+c.UrgentSlots+c.FillSlots+c.IdleSlots > 256 || c.PayloadBytes <= 0 || c.COWBytes <= 0 || c.BytesPerSecond <= 0 || c.FallbackVolumes < 1 || c.FallbackVolumes > 65536 || c.MaxHold <= 0 { + if !filepath.IsAbs(c.Directory) || c.NormalSlots < 1 || c.NormalSlots > 256 || c.UrgentSlots < 1 || c.UrgentSlots > 256 || c.FillSlots < 0 || c.FillSlots > 256 || c.IdleSlots < 0 || c.IdleSlots > 256 || c.NormalSlots+c.UrgentSlots+c.FillSlots+c.IdleSlots > 256 || c.PayloadBytes <= 0 || c.COWBytes <= 0 || c.BytesPerSecond <= 0 || c.FallbackVolumes < 1 || c.FallbackVolumes > 65536 || c.NoProgress <= 0 { return errors.New("hostlimit: invalid configuration") } return nil @@ -91,6 +93,7 @@ type lease struct { payload, cow int64 abort func(error) timer *time.Timer + lastProgress atomic.Int64 // unix nanoseconds of the work's last progress (or the admission) releasing bool revoked bool } @@ -345,7 +348,8 @@ func (l *Limiter) Admit(ctx context.Context, payload int64, abort func(error)) ( l.stats.Fallback++ l.stats.FallbackActive = true } - x.timer = time.AfterFunc(l.cfg.MaxHold, func() { l.revoke(id) }) + x.lastProgress.Store(time.Now().UnixNano()) + x.timer = time.AfterFunc(l.cfg.NoProgress, func() { l.expire(id) }) l.mu.Unlock() if warnFallback { log.Printf("hostlimit: shared cut pool unavailable (%v); using static fallback, shared memory/spill cap NOT enforced", err) @@ -353,8 +357,36 @@ func (l *Limiter) Admit(ctx context.Context, payload int64, abort func(error)) ( return id, nil } -// Progress reports that the work holding id progressed (seam). -func (l *Limiter) Progress(id uint64) {} +// Progress reports that the work holding id progressed (a chunk compared, +// staged, uploaded or filled): its hold's no-progress window starts again. It +// takes no OS call and never blocks on the pool; an unknown or released id is +// ignored. +func (l *Limiter) Progress(id uint64) { + l.mu.Lock() + x := l.live[id] + l.mu.Unlock() + if x != nil { + x.lastProgress.Store(time.Now().UnixNano()) + } +} + +// expire runs when a hold's timer fires: a hold that progressed within its +// window is armed again for the rest of it; one that did not is revoked. +func (l *Limiter) expire(id uint64) { + l.mu.Lock() + x := l.live[id] + if x == nil || x.releasing || x.revoked { + l.mu.Unlock() + return + } + if idle := time.Since(time.Unix(0, x.lastProgress.Load())); idle < l.cfg.NoProgress { + x.timer.Reset(l.cfg.NoProgress - idle) + l.mu.Unlock() + return + } + l.mu.Unlock() + l.revoke(id) +} func (l *Limiter) revoke(id uint64) { l.mu.Lock() diff --git a/seaweed-block/core/hostlimit/limiter_test.go b/seaweed-block/core/hostlimit/limiter_test.go index 05b23eb02a..cf31575272 100644 --- a/seaweed-block/core/hostlimit/limiter_test.go +++ b/seaweed-block/core/hostlimit/limiter_test.go @@ -121,7 +121,7 @@ func TestCOWAbortHoldsSlotUntilWorkerSettlement(t *testing.T) { } func TestHoldExpiryAndCloseDoNotSteal(t *testing.T) { c := testConfig(t) - c.MaxHold = 30 * time.Millisecond + c.NoProgress = 30 * time.Millisecond a, b := newTest(t, c), newTest(t, c) revoked := make(chan struct{}, 4) x, e := a.Admit(context.Background(), 1, func(error) { revoked <- struct{}{} }) diff --git a/seaweed-block/core/storage/chunk_cut_budget.go b/seaweed-block/core/storage/chunk_cut_budget.go index 1affc5d6ba..b68022a1db 100644 --- a/seaweed-block/core/storage/chunk_cut_budget.go +++ b/seaweed-block/core/storage/chunk_cut_budget.go @@ -16,12 +16,22 @@ type Budget interface { Release(ticket uint64) } -// BudgetProgress is a Budget that renews a hold while its work progresses -// (seam). +// BudgetProgress is a Budget that renews a hold while its work progresses: +// Progress reports one unit of work done under ticket (a chunk compared, +// staged, uploaded or filled). It must be nonblocking and perform no I/O. type BudgetProgress interface { Progress(ticket uint64) } +// budgetProgress is the report that renews ticket's hold; a no-op when the +// Budget does not renew holds. +func budgetProgress(b Budget, ticket uint64) func() { + if p, ok := b.(BudgetProgress); ok { + return func() { p.Progress(ticket) } + } + return func() {} +} + type cutBudgetReservation struct { budget Budget ticket uint64 diff --git a/seaweed-block/core/storage/chunk_cut_observation.go b/seaweed-block/core/storage/chunk_cut_observation.go index 01f174dc8b..cea4e073d7 100644 --- a/seaweed-block/core/storage/chunk_cut_observation.go +++ b/seaweed-block/core/storage/chunk_cut_observation.go @@ -19,11 +19,21 @@ const ( type cutAttemptObservation struct { compared, staged, uploaded atomic.Int64 - spans [cutWorkSpanCount]atomic.Int64 - counts [cutWorkCountCount]atomic.Int64 + // progress renews the attempt's host hold (set at its admission, before + // any worker starts; nil without a budget). + progress func() + spans [cutWorkSpanCount]atomic.Int64 + counts [cutWorkCountCount]atomic.Int64 } type cutObservationKey struct{} +// progressed reports one unit of the attempt's work to its host hold. +func (w *cutAttemptObservation) progressed() { + if w != nil && w.progress != nil { + w.progress() + } +} + func cutObservation(ctx context.Context) *cutAttemptObservation { w, _ := ctx.Value(cutObservationKey{}).(*cutAttemptObservation) return w diff --git a/seaweed-block/core/storage/chunk_cut_payload.go b/seaweed-block/core/storage/chunk_cut_payload.go index 95a455950f..0278e5acc6 100644 --- a/seaweed-block/core/storage/chunk_cut_payload.go +++ b/seaweed-block/core/storage/chunk_cut_payload.go @@ -61,6 +61,7 @@ func (l *chunkLayerImpl) streamCutPayloads(ctx context.Context, batch []uint64, work := cutObservation(ctx) if work != nil { work.compared.Add(1) + work.progressed() } ref, had := head.Chunks[c.idx] if !c.zero && !(had && ref.SHA256 == c.sum && !l.owning(c.idx)) { @@ -80,6 +81,9 @@ func (l *chunkLayerImpl) streamCutPayloads(ctx context.Context, batch []uint64, if staging { work.staged.Add(1) } + if c.key != "" || staging { + work.progressed() + } } l.rememberPayload(c, head.Gen, staging) l.markEqualNow(c, head) diff --git a/seaweed-block/core/storage/chunk_cut_revoke_reuse_test.go b/seaweed-block/core/storage/chunk_cut_revoke_reuse_test.go index f90f7f6547..8c048fec78 100644 --- a/seaweed-block/core/storage/chunk_cut_revoke_reuse_test.go +++ b/seaweed-block/core/storage/chunk_cut_revoke_reuse_test.go @@ -7,7 +7,7 @@ import ( ) // revokingBudget admits every cut and keeps its abort, so the test can -// revoke the cut's host budget the way the limiter does at MaxHold. +// revoke the cut's host budget the way the limiter does when its no-progress window passes. type revokingBudget struct{ abort func(error) } func (b *revokingBudget) Admit(_ context.Context, _ int64, abort func(error)) (uint64, error) { @@ -33,7 +33,7 @@ type revokeAfterRemote struct { func (r *revokeAfterRemote) Put(ctx context.Context, key string, b []byte) error { if r.after >= 0 && r.completed == r.after { - r.budget.abort(errors.New("test: cut held its host slot past MaxHold")) + r.budget.abort(errors.New("test: cut held its host slot past its no-progress window")) <-ctx.Done() return context.Cause(ctx) } @@ -49,7 +49,7 @@ func (r *revokeAfterRemote) Put(ctx context.Context, key string, b []byte) error return nil } -// A cut whose host budget is revoked mid-upload (MaxHold) keeps the +// A cut whose host budget is revoked mid-upload (no progress within its window) keeps the // chunks it already uploaded: the next cut uploads only the rest, fewer // bytes than the whole dirty set, and retransmits nothing. func TestCutRevokedMidUploadKeepsItsUploads(t *testing.T) { diff --git a/seaweed-block/core/storage/chunk_layer.go b/seaweed-block/core/storage/chunk_layer.go index 05cc317428..14406f0a84 100644 --- a/seaweed-block/core/storage/chunk_layer.go +++ b/seaweed-block/core/storage/chunk_layer.go @@ -1109,6 +1109,7 @@ func (l *chunkLayerImpl) captureLocked(ctx context.Context, detach bool) (res ch return chunkCutResult{}, fmt.Errorf("%w: budget admission: %w", errChunkCaptureRefused, admitErr) } budget = &cutBudgetReservation{budget: host, ticket: ticket, ctx: ctx} + work.progress = budgetProgress(host, ticket) defer func() { if err != nil { err = errors.Join(err, context.Cause(budgetCtx)) @@ -1395,6 +1396,7 @@ func (l *chunkLayerImpl) captureLocked(ctx context.Context, detach bool) (res ch err := l.putCapturedWith(ctx, u.key, u.c.data, func(ctx context.Context) error { return put(ctx, i, u.key, u.c.data) }) if err == nil { work.uploaded.Add(1) + work.progressed() } return err }); err != nil { diff --git a/seaweed-block/docs/design/invariants.md b/seaweed-block/docs/design/invariants.md index 63e38a18f2..5b0e57efb9 100644 --- a/seaweed-block/docs/design/invariants.md +++ b/seaweed-block/docs/design/invariants.md @@ -509,7 +509,7 @@ snapshot lifetime; local persistence does not bypass it. ### M7. Host background-cut admission -`free -> admitted -> draining -> joined -> released`; process death releases its OS slot. Configuration is published by temporary-file sync and rename under its OS lock; a killed initializer leaves no partially visible configuration. Admission precedes staging/barrier; expiry cancels the cut but keeps its slot until workers join. Urgent can borrow normal slots; normal cannot borrow urgent. Unavailable pools skip background work with an alarm; urgent move-final and named seals may use per-process fallback with no coordinated host-cap claim. Guest COW only accounts locally; guest I/O and WAL reclamation never acquire slots. +`free -> admitted -> draining -> joined -> released`; process death releases its OS slot. Configuration is published by temporary-file sync and rename under its OS lock; a killed initializer leaves no partially visible configuration. Admission precedes staging/barrier; a hold is revoked only after its no-progress window (`NoProgress`, default 60 s) passes with no progress of its work (a chunk compared, staged or uploaded by the cut; `INV-HOST-HOLD-NO-PROGRESS-001`), and revocation cancels the cut but keeps its slot until workers join. Urgent can borrow normal slots; normal cannot borrow urgent. Unavailable pools skip background work with an alarm; urgent move-final and named seals may use per-process fallback with no coordinated host-cap claim. Guest COW only accounts locally; guest I/O and WAL reclamation never acquire slots. ### M8. Attached-volume maintenance @@ -994,6 +994,7 @@ Notes: | `INV-HOST-CUT-BUDGET-001` | A cooperating cut process holds a host OS slot from its admission, before staging or the capture barrier: see M7 free → admitted. | M7 free → admitted | `core/hostlimit/limiter.go` `Admit`; `core/storage/chunk_cut_budget.go`; blockvolume host-limit flags | `TestSlotsUrgentAndJoinedRelease` (`core/hostlimit/limiter_test.go`); `TestHostCutLimitDoesNotGateGuestIO` (`core/frontend/durable/host_limit_test.go`) | `HostBudget` HeldUntilJoined/PayloadBound/SpillBound (bounded OS-lock abstraction; fallback excluded) | ACTIVE | | `INV-HOST-CUT-BUDGET-RESERVE-001` | Each admitted slot, urgent included, carries at most PayloadBytes of cut payload and at most COWBytes of COW side bytes; a reservation beyond COWBytes revokes the slot and aborts its cut. | M7 admitted | `core/hostlimit/limiter.go` `Admit`, `ReserveCOW`; `core/storage/chunk_cut_budget.go` | `TestHostCOWCapAbortsCutAndRetainsPermitUntilJoin` (`core/storage/chunk_host_budget_test.go`); `TestSlotsUrgentAndJoinedRelease` (`core/hostlimit/limiter_test.go`) | `HostBudget` PayloadBound/SpillBound | ACTIVE | | `INV-HOST-CUT-BUDGET-SETTLE-001` | A slot's OS lock is released only after its cut's workers settle and Release is called; cancellation, hold expiry and limiter Close abort the cut but keep the slot until then. | M7 draining → joined → released | `core/hostlimit/limiter.go` `Release`, `releaseLoop`, `revoke`, `Close`; `core/storage/chunk_layer.go` `captureLocked` | `TestCOWAbortHoldsSlotUntilWorkerSettlement`, `TestHoldExpiryAndCloseDoNotSteal`, `TestKilledProcessReleasesButLiveHolderDoesNot` (`core/hostlimit/limiter_test.go`); `TestHostCOWCapAbortsCutAndRetainsPermitUntilJoin` (`core/storage/chunk_host_budget_test.go`) | `HostBudget` HeldUntilJoined | ACTIVE | +| `INV-HOST-HOLD-NO-PROGRESS-001` | A held slot is revoked only after its no-progress window passes with no reported progress of its work (a chunk compared, staged or uploaded by its cut): work that keeps progressing is never revoked, and a stalled hold is revoked within the window. | M7 admitted → draining (revoked) | `core/hostlimit/limiter.go` `Admit`, `Progress`, `expire`; `core/storage/chunk_cut_budget.go` `BudgetProgress`, `budgetProgress`; `core/storage/chunk_cut_observation.go` `progressed`; `core/storage/chunk_layer.go` `captureLocked` | `TestStalledHoldIsRevokedWithinTheWindow`, `TestProgressRenewsTheHold` (`core/hostlimit/limiter_progress_test.go`); `TestCutReportsProgressToItsBudget` (`core/storage/chunk_cut_hold_progress_test.go`) | SlotShare (its progress-window rule; the share rule is a later change) | ACTIVE | | `INV-HOST-CUT-BUDGET-CONFIG-001` | A busy configuration lock or a mismatched pool configuration refuses every class, urgent included, with no fallback. | M7 free → admitted (refused) | `core/hostlimit/limiter.go` `pool`, `Admit` | `TestConfigurationLockContentionRefusesAllClasses` (`core/hostlimit/limiter_test.go`) | — | ACTIVE | | `INV-HOST-CUT-BUDGET-FALLBACK-001` | Only urgent admissions (urgent move-final cuts and named seals) proceed while the pool is unavailable, on a per-process fallback that claims no host-wide bound, leaves uploads unpaced while only fallback leases live, and is reported as fallback while any such lease lives. | M7 free → admitted (pool unavailable) | `core/hostlimit/limiter.go` `Admit`, `releaseLoop`, `WaitUpload` | `TestUnusablePoolClassPolicy`, `TestLastFallbackReleaseClearsActiveStatus`, `TestUrgentFallbackUploadIsNotPaced`, `TestFallbackDoesNotUnpaceAHealthyLease`, `TestConfigurationLockFailurePreservesPoolPolicy` (`core/hostlimit/limiter_test.go`); `TestChunkControl_NamedSnapshotUsesUrgentFallback` (`core/host/volume/chunk_control_adapter_test.go`) | `HostBudget` (fallback excluded) | ACTIVE | | `INV-HOST-CUT-BUDGET-PACING-001` | A process's upload pacing debt carries across its own leases, and a new process starts with no debt. | M7 admitted (upload pacing) | `core/hostlimit/limiter.go` `WaitUpload` | `TestPacingDebtSurvivesOwnLeaseTurnover`, `TestPacingFreshProcessesDoNotShareDebt` (`core/hostlimit/limiter_test.go`) | — | ACTIVE | @@ -1024,7 +1025,7 @@ Notes: - `INV-CUT-TIMER-RESTART-001`, `INV-CUT-TIMER-SKIP-001`: cuts are identified and ordered by the layer's in-process `CutSeq`, never by the `LastCutNs` wall stamp: a `CutSeq` not seen before is a success at the moment it is observed, and a periodic decision is skipped once `CutSeq` has moved; at start the existing value is not new, so a restart keeps the startup phase. The scheduled-snapshot worker (`INV-SNAP-SCHEDULED-KEEP-001`) runs on the same monotonic time: a new attachment seeds its due time at the next stable per-volume grid slot after HEAD's newest scheduled snapshot, or is due immediately without scheduled history. Future creation times are clamped to now. A re-armed loop on the same handle keeps its schedule (failures, retry time); a restart restores the last success and overdue age from HEAD. Tests: `TestScheduledSnapshotLoop_TakesEachSlotOnMonotonicTime`, `_RearmKeepsTheSchedule`, `_OverdueWithNoSuccess`, `TestSnapshotSchedule_SlotsAreOffsetPerVolume`. - Not reachable in this release: `INV-WS-FREEZE-ACCOUNTING-001` (except its estimate and quiesce-slack report, which every successful cut returns) and `INV-CUT-PRECOPY-001`. `/chunk/detach` refuses `frozen` (`INV-CUT-FROZEN-DETACH-REFUSED-001`) and blockvolume refuses `--chunk-detach-precopy` (`INV-CUT-PRECOPY-FLAG-REFUSED-001`), so neither the frozen admission nor the pre-copy admission runs in a released process. Their code is kept and their tests below the HTTP handler still assert them, so their status stays ACTIVE. For the same reason the pre-copy policy that `INV-CUT-PLAIN-DETACH-001` keeps for an absent or false `plain` field is always off. `INV-WS-FREEZE-REFUSAL-001` stays reachable: its HTTP400 validation runs before the refusal. So do `INV-WS-FREEZE-REFUSAL-INPUTS-001` and `INV-WS-FREEZE-REFUSAL-PRECEDENCE-001`. - `INV-WS-FREEZE-REFUSAL-001`: a generic `bad_request` is not proof of a clean refusal. The validation also refuses a non-frozen request that carries a freeze origin (`handleChunkDetach`). `INV-WS-FREEZE-REFUSAL-INPUTS-001` compares the caller's Unix-nanosecond origin with blockvolume's `time.Now`, with no skew bound. -- `INV-HOST-CUT-BUDGET-001`: an unavailable pool skips normal, fill and idle work with an alarm: see M7 (test `TestUnusablePoolClassPolicy`). Coordinated reservations do not account retained crash spill, fallback leases or process RSS (`HostBudget` excludes fallback). Guest I/O and WAL reclamation never take a slot (M7). Hold expiry (`MaxHold`, `INV-HOST-CUT-BUDGET-SETTLE-001`) and upload pacing (`INV-HOST-CUT-BUDGET-PACING-001`) run on the process's local clock. +- `INV-HOST-CUT-BUDGET-001`: an unavailable pool skips normal, fill and idle work with an alarm: see M7 (test `TestUnusablePoolClassPolicy`). Coordinated reservations do not account retained crash spill, fallback leases or process RSS (`HostBudget` excludes fallback). Guest I/O and WAL reclamation never take a slot (M7). Hold expiry (the no-progress window `NoProgress`, `INV-HOST-HOLD-NO-PROGRESS-001`; the slot kept until its workers join, `INV-HOST-CUT-BUDGET-SETTLE-001`) and upload pacing (`INV-HOST-CUT-BUDGET-PACING-001`) run on the process's local clock. - Enforced by reading (no test asserts it): the refusal of a non-frozen request that carries a freeze origin; and an explicit zero freeze origin, which the test sends only as a missing origin (both decode to zero). - `INV-CUT-PRECOPY-001`: Opt-in final-tail admission closes frontend admission, drains registered I/O before the store lock within a 100 ms caller context, then uses authoritative barrier candidates and measured costs. Ordinary refusal reopens tentative admission before rolling uploads; guest-frozen refusal instead sends no payload. A contended freeze fallback never replaces an existing pause or its queue clock. Final freeze queues without completion for up to five seconds; on resume every queued waiter is granted in arrival order under one lock hold; each then passes the normal gate; completion is unordered. The ended pause is cleared before those normal gate checks; queue deadlines are measured once from each command arrival and capped by five seconds or its earlier caller deadline, so independent I/O is concurrent and later arrivals cannot inherit an expired pause; host drain preserves the active queue, and transport teardown cancels commands before joining; no queued storage work is issued. Only settled detached publication permits handoff; aborted rounds retain dirty bytes. Warm attempts and measurement rounds are reported separately, with samples at start; both consume the same five-round budget. Admission fits the allowance, or declares an estimate within five seconds when it is at least 90% of the previous comparable known estimate, or on the final physical round. A nonempty tail stays samples_unknown until a successful rolling upload supplies a positive measured rate; the stop's own rounds count, and the conservative rate uses up to the latest three observations. The fixed input is the maximum of up to the latest five observations younger than fifteen minutes; disjoint parts come from the same selected observation. An empty tail needs no rate or fixed history: it declares the full ordinary allowance and reports an actual overrun. Ordinary admission never invents an upload rate. A guest-frozen attempt skips staging, forecasts and rechecks against five seconds minus guest elapsed, and refuses without uploading if it cannot fit. Only an explicit final override can bypass that estimate guard, with over_budget recorded; authority and publication settlement remain mandatory. Checkpoint tails are advisory same-window measurements. Nested Sync phases and live barrier-prefix spans explain fixed cost without double counting.