Repository navigation
fix: raise the meta busy-retry ceiling and quiesce the network when the stopped flip fails - #281
Merged
Merged
Conversation
Concurrent memory dumps (vm hibernate, snapshot save) on the same filesystem as meta.db make the occasional WAL fsync slow (p90 ~160ms), and the writer queue behind it starves past 5s. The failure lands after the dump is already captured, so the work is thrown away and a hibernating VM is resumed. At 64 concurrent hibernates on bare metal, 5s failed 19-22 of 64 per round; 30s failed 0 of 448 operations across hibernate and save storms up to 128-way, with throughput unchanged (disk-bound). Max observed wait was 11s at 64-way and 21s at 128-way.
…ped flip fails After a confirmed VMM exit the Stopped flip is warn-and-continue, but a failed flip also skipped the network quiesce: the record still reads Running with QuiescePending unset, so a CNI VM kept its host plumbing up with a dead TAP (the #130 softirq precondition) until a daemon reconcile or the next start/restore. The quiesce now keys on the VM having gone down, and the flip outcome only fences the generation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Concurrent
vm hibernate/snapshot savestorms fail withwriter contended past retry ceiling: store busyonce roughly 32 or more run at once.Root cause
When meta.db sits on the same filesystem as the memory dumps, most commits are sub-millisecond. The occasional WAL fsync, though, queues behind the dump flush (
SyncTree): p90 is about 160ms and the max about 330ms. One slow commit stalls every writer queued behind it, and the waits starve past the 5s ceiling. The failure lands after the dump is already captured, so that work is thrown away and a hibernating VM is resumed.Isolation on bare metal: 64 x 512M VMs, 64 concurrent hibernates, two arms interleaved x3. The arms differ only in where meta.db lives; snapshot data stays on xfs in both.
Changes
Busy-retry ceiling 5s -> 30s. Both arms are built from master and differ only in this constant, interleaved:
Throughput is the same in every arm, about 6 dumps/s, because it is disk-bound. The wait grows with queue depth, so callers that fan out dumps should still bound their concurrency; the ceiling is a backstop, not admission control.
Stop and hibernate quiesce the network when the Stopped flip fails. After a confirmed VMM exit the flip is warn-and-continue. A failed flip also skipped the network quiesce, because the record still reads Running with
QuiescePendingunset. A CNI VM therefore kept its host plumbing up with a dead TAP (the fix(cni): quiesce host NICs on stop to end the idle-TAP softirq storm #130 precondition) until a daemon reconcile or the next start/restore. With the 5s ceiling this was observed: hibernate exited 0 after loggingmark stopped ...: store busy. The quiesce now keys on the VM having gone down, and the flip outcome only fences the generation.Tests
TestHibernateSequenceQuiescesWhenTheStoppedFlipFailsandTestStopQuiescesWhenTheStoppedFlipFails. Both inject a busy store after terminate; both fail without the fix (quiesced = 0) and pass with it.go test -race ./...passes on darwin../hypervisor/... ./meta/...pass on linux.make lintreports 0 issues on linux and darwin, andaslis clean.