Repository navigation
Commit d6391d8
Make the ledger storage status row independent of concurrent disk writes
The ledger_observability_status row compared the free_disk_bytes that
the live runner publishes with a second sample of the free disk space
that the test took later, within a fixed tolerance of 64 MiB. On a
machine whose filesystem other processes write, such as a shared build
machine that runs several test steps at once, more than the tolerance
can change between the two samples, and the row failed although the
runner had reported a true figure at its own sampling instant. The
expected state and the seconds_to_disk_exhaustion bound leaned on the
same second sample.
The row now checks the status document against itself and against the
free space that the test observed during the window:
- state and seconds_to_disk_exhaustion are computed from the document's
own used_bytes, warn_free_fraction, free_disk_bytes and
growth_bytes_per_second, exactly: rational arithmetic for the state,
the same IEEE division as the runner for the exhaustion time;
- free_disk_bytes must be an integer, a multiple of the filesystem's
fragment size, within its capacity, and a value the filesystem
really had: the test samples the free space throughout the window
that contains the runner's sample, from before it until after the
second publication that follows, and keeps the smallest and the
largest value it saw. Two samples, one on each side, would not do: a
temporary file that appears and disappears while the runner samples
puts its value outside both. On a quiet disk the range is a single
value, so the check is exact; there is no tolerance;
- the ledger lives in a directory of its own, and the status and log
files of the runner go to another filesystem (/dev/shm for the disk
row), so the runner's own writes cannot change the free space it
measures. The default fraction also runs with the ledger on /dev/shm,
so a runner that measured the wrong directory would fail.
The option --disk-sample-tolerance-bytes is removed. The row
ledger_observability_status_concurrent_write writes 192 MiB into the
ledger's directory between the runner's document and the end of the
window, and ledger_observability_check_selftest feeds the check helpers
and the envelope with synthetic numbers to show that every wrong value
(units, capacity, another filesystem, one ulp, a flipped state) is
rejected and that the range has no allowance at either end.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>1 parent 9ee1cc7 commit d6391d8
2 files changed
Lines changed: 320 additions & 66 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
601 | 601 | | |
602 | 602 | | |
603 | 603 | | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
604 | 608 | | |
605 | 609 | | |
606 | 610 | | |
| |||
740 | 744 | | |
741 | 745 | | |
742 | 746 | | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
743 | 756 | | |
744 | 757 | | |
745 | 758 | | |
| |||
0 commit comments