What does Single-Host Hot Migration and the Ten-Second Contract conclude, in numbers, about “The Empirical Loop: a Local Drill Checklist, the Hot-Migration Interruption Window Calculator and a Pre-Registered Test”?
Answer: Chapter 8 gives a ten-step local drill checklist, the distilled Hot-Migration Interruption Window Calculator and a pre-registered test, in which 59 consecutive drills without a breach are needed to say with 95 % confidence that the breach rate is below 0.05. Marked boxes separate published evidence, runnable Python calculations (22 programs), classical sources and the author's hypotheses.
Scope of the numbers: Examples use fictional names, parameters are illustrative, and all calculations come from the book's programs, which connect to no server. Marked boxes separate published evidence, runnable Python calculations (22 programs), classical sources and the author's hypotheses.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 0.05, 59, 95
| z values | 1.9600 (alpha/2) and 0.8416 (power) |
| drills per arm, two-proportion test: | |
| 0.60 vs 0.90 | 32 per arm |
| 0.80 vs 0.95 | 76 per arm |
| 0.90 vs 0.99 | 100 per arm |
| drills to bound the failure rate below p at 95 per cent: | |
| p | 0.05: 59 with 0 failures, 93 with 1, 124 with 2 |
| p | 0.01: 299 with 0 failures, 473 with 1, 628 with 2 |
Show the full program
# Chapter 8. p82: sample sizes for a pre-registered local drill study.
# Model 1: compare the share of drills that recover within 10 s with no
# data difference under two procedures (big-bang against
# expand-contract) by a two-sided two-proportion z test, alpha 0.05,
# power 0.80: n per arm = (z_a sqrt(2 pb (1 - pb)) + z_b sqrt(p1 (1 -
# p1) + p2 (1 - p2)))^2 / (p1 - p2)^2, pb the mean of p1 and p2.
# Model 2: to claim with 95 per cent confidence that the failure rate
# of one procedure is below p, run n drills with at most f failures,
# the smallest n with P(X <= f | n, p) <= 0.05 (exact binomial).
# The proportions are illustrative targets, not results.
import math
import statistics
nd = statistics.NormalDist()
ZA = nd.inv_cdf(0.975)
ZB = nd.inv_cdf(0.80)
def n_two(p1, p2):
pb = 0.5 * (p1 + p2)
num = (ZA * math.sqrt(2.0 * pb * (1.0 - pb))
+ ZB * math.sqrt(p1 * (1.0 - p1) + p2 * (1.0 - p2)))
return math.ceil(num * num / (p1 - p2) ** 2)
def cdf_binom(f, n, p):
return math.fsum(math.comb(n, j) * p ** j * (1.0 - p) ** (n - j)
for j in range(f + 1))
def n_bound(p, f):
n = f + 1
while cdf_binom(f, n, p) > 0.05:
n += 1
return n
print("z values: %.4f (alpha/2) and %.4f (power)" % (ZA, ZB))
print("drills per arm, two-proportion test:")
for p1, p2 in ((0.60, 0.90), (0.80, 0.95), (0.90, 0.99)):
print(" %.2f vs %.2f -> %d per arm" % (p1, p2, n_two(p1, p2)))
print("drills to bound the failure rate below p at 95 per cent:")
for p in (0.05, 0.01):
print(" p = %.2f: %d with 0 failures, %d with 1, %d with 2" % (
p, n_bound(p, 0), n_bound(p, 1), n_bound(p, 2)))Single source and citation
Fan, Y. (2026). Zero-Downtime Hot Migration and Rollback on Multi-Container Single Hosts: Lossless Schema Evolution behind a Shared Tunnel and a Ten-Second Stop-the-Bleeding Contract (Version 1.0.0), Chapter 8: The Empirical Loop: a Local Drill Checklist, the Hot-Migration Interruption Window Calculator and a Pre-Registered Test. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 5DL-B-269 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026269,
author = {Fan, Yafu},
title = {Zero-Downtime Hot Migration and Rollback on Multi-Container Single Hosts: Lossless Schema Evolution behind a Shared Tunnel and a Ten-Second Stop-the-Bleeding Contract},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}Other chapter answers in this book
- Chapter 1 · Blue-Green Is Not Zero Downtime: the Interruption Window Set by Health Checks, Failure Thresholds and Connection Drain
- Chapter 2 · Expand-Contract Migration: the Rollbackability Graph and Pushing Irreversible Steps to the End
- Chapter 3 · The Availability Markov Chain: How Repair Time Eats the Yearly Budget
- Chapter 4 · Many Containers on One Host behind a Shared Tunnel: Common-Cause Failure, Reconnect Backoff and Memory Headroom for Dual Running
- Chapter 5 · Lossless Evolution of a Production Database: Backfill Pace, Dual-Write Verification and the Write-Freeze Window
- Chapter 6 · The Ten-Second Stop-the-Bleeding Contract: Convolving the Time Budget, False and Missed Alarms, and the Rot of Rollback Paths
- Chapter 7 · The Classical Sources Examined: "When a Course Runs Out, Change" and the Ship of Theseus