What does Single-Host Hot Migration and the Ten-Second Contract conclude, in numbers, about “Expand-Contract Migration: the Rollbackability Graph and Pushing Irreversible Steps to the End”?

Answer: Chapter 2 draws migration as a rollbackability graph: with a 24 hour bake, expand-contract has a rollback failure rate 10.39 times lower than a one-shot migration, and with two coexisting containers only 8 of 560 interleavings are safe.

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: 10.39, 24

expand-contract: bake B (hours) before each contract step
       B    P(fast)      P(ok)    E[time] s
       0     0.0000     0.8802       3909.0
       1     0.3645     0.9364       1999.7
       6     0.7086     0.9741        763.0
      24     0.8930     0.9904        242.8
      72     0.9634     0.9957         78.5
     168     0.9866     0.9972         31.7
     720     0.9984     0.9979         11.3
big-bang: every rollback is a restore of 3600 s
  restore success 0.50 -> P(ok) 0.5000
  restore success 0.70 -> P(ok) 0.7000
  restore success 0.90 -> P(ok) 0.9000
  restore success 0.99 -> P(ok) 0.9900
B = 24 h against big-bang at 0.90: failure 0.0096 vs 0.1000, ratio 10.39
Show the full program
# Chapter 2. p22: rollback success against the bake period before the
# contract steps (a dose-response sweep).
# Model: a migration carries a latent fault. Once the new read path is
# live, the fault is noticed after a time X, lognormal with median 2 h
# and spread 2 (most faults show within hours, a few after weeks).
# Expand-contract waits a bake period B before step F (stop old
# write) and another B before step G (drop old column). The rollback
# cost then depends on where X falls (times and success from p21):
#   X < B        fast undo, 9 s, success 0.998
#   B <= X < 2B  undo with reverse backfill, 309 s, success 0.978
#   X >= 2B      restore from backup, 3909 s, success 0.8802
# Big-bang is irreversible from the start: restore with success r.
# All figures are illustrative.
import math

MED_H = 2.0
SPREAD = 2.0
TIERS = ((9.0, 0.998), (309.0, 0.978), (3909.0, 0.8802))
BAKES = (0.0, 1.0, 6.0, 24.0, 72.0, 168.0, 720.0)


def cdf(x_h):
    if x_h <= 0.0:
        return 0.0
    z = (math.log(x_h) - math.log(MED_H)) / SPREAD
    return 0.5 * (1.0 + math.erf(z / math.sqrt(2.0)))


def expand_contract(bake):
    p1 = cdf(bake)
    p2 = cdf(2.0 * bake) - p1
    p3 = 1.0 - p1 - p2
    w = (p1, p2, p3)
    succ = math.fsum(wi * s for wi, (_, s) in zip(w, TIERS))
    time = math.fsum(wi * t for wi, (t, _) in zip(w, TIERS))
    return p1, succ, time


print("expand-contract: bake B (hours) before each contract step")
print("%8s %10s %10s %12s" % ("B", "P(fast)", "P(ok)", "E[time] s"))
for b in BAKES:
    p1, s, t = expand_contract(b)
    print("%8.0f %10.4f %10.4f %12.1f" % (b, p1, s, t))
print("big-bang: every rollback is a restore of %.0f s" % 3600.0)
for r in (0.5, 0.7, 0.9, 0.99):
    print("  restore success %.2f -> P(ok) %.4f" % (r, r))
_, s24, _ = expand_contract(24.0)
print("B = 24 h against big-bang at 0.90: failure %.4f vs %.4f,"
      " ratio %.2f" % (1.0 - s24, 0.10, 0.10 / (1.0 - s24)))

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 2: Expand-Contract Migration: the Rollbackability Graph and Pushing Irreversible Steps to the End. 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