serial-number-arithmetic · unknown · also Sequence-space arithmetic

Serial number arithmetic

Serial number arithmetic compares finite wrapping counters within a bounded sequence space.

For a b-bit counter, differences are taken modulo 2^b and ordering at exactly half the space is undefined. A difference below half the space identifies a forward direction, not how much unobserved history elapsed. [1]

Pairwise comparisons do not provide an unrestricted sort order. In an 8-bit space, 0 precedes 100, 100 precedes 200, and 200 precedes 0. A shared unwrapped interval with span below half the space avoids this cycle. [3]

JBD2 compares transaction IDs using signed differences. Interpreting such counters requires the journal identity and lifetime bounds as well as their numeric values. [2]

Relations

related
Transaction ID wraparound, Lost write, Write-ahead log, Incarnation identifier

Citations

  1. Elz and Bush. RFC 1982: Serial Number Arithmetic, sections 3-5 (1996) (accessed 2026-10-18)
  2. Linux v6.16 include/linux/jbd2.h: tid_gt and tid_geq (accessed 2026-10-18)
  3. Hesela: ordering storage generations across counter wrap (accessed 2026-10-18)
Sources & caveats
  • RFC 1982 specifies DNS serial arithmetic, not a storage format. [1]
  • The linked enumeration is an exact teaching example, not a device failure-rate measurement or a recovery implementation. [3]

JSON: /data/terms/serial-number-arithmetic.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Serial number arithmetic. Hesela. 2026-10-18. https://hesela.dev/terms/serial-number-arithmetic/