Repository navigation
tests: Cap oci-delta's bsdiff size in the switch-from-delta test - #13
jmarrero-bot wants to merge 1 commit into
Conversation
jmarrero-bot
left a comment
There was a problem hiding this comment.
Verdict: ship as-is. Reviewed head 1a2fa133 against c3be5244; no blocking findings.
Optional wording nit — tmt/tests/booted/test-switch-from-delta.nu:67: “Above the cap it uses rollsums” is conditional in tar-diff v0.6.1: rollsum matches must exceed 20%; otherwise it copies the file content. Consider “Above the cap this UKI uses rollsums.” The UKI-specific claims in the commit message and PR body are consistent with the measurements.
The root cause checks out: the CI artifact confirms a global guest OOM kill, no swap, and anon-rss:3641696kB. oci-delta v0.3.1 depends on tar-diff v0.6.1, defaults to bsdiff with a 192 MiB cap, and converts the new flag from MiB to bytes. The cap checks both old and new file sizes. bsdiff allocates two (old size + 1) int arrays, approximately 16 bytes per old byte on this 64-bit job, plus input buffers and other heap overhead. The recorded GOGC experiments support the GC explanation without establishing the exact GC state of the failed CI run.
The test remains meaningful: it removes the target image, switches from the delta, verifies staged and booted digests, checks the marker after reboot, and runs fsck. The measured ~3.35 MB delta retains useful binary-delta coverage. Recorded devspace testing (4/4 at this head and 2/2 with GOGC=200, versus 2/2 failures on main with GOGC=200) is adequate for this test-only change; the PR body agrees with the linked gist.
Commit hygiene passes: one scoped commit, imperative subject and why-body, bot author/committer, Generated-by: AI, no sign-off or fixup commits. bot-git check and git diff --check passed locally. No builds or tests were run for this review.
jmarrero-bot
left a comment
There was a problem hiding this comment.
Review guide for head 1a2fa13304: where to look closely and what is safe to skim. It is advice from the bot's reviewer and doesn't replace reading the diff; the review app walks it.
Test-only change: plan-51-switch-from-delta passes --max-bsdiff-size 64 to oci-delta create so the ~122 MiB rebuilt UKI goes through tar-diff's rollsum path instead of bsdiff, whose suffix sort allocates two []int arrays the size of the old file (~16 bytes per byte, ~2 GiB here) and got oci-delta OOM-killed in CI's 4 GiB swapless VM. The root cause checks out against tar-diff v0.6.1 (bsdiff.go, diff.go generateForFile) and CI's console.txt (global OOM, 1046979 pages RAM, swap 0, oci-delta anon-rss 3641696 kB). The delta stays tar-diff format v1 (binary-diff is still bsdiff), the 16 MB composefs .dump still goes through bsdiff, and rollsums emit only ops bootc's oci-delta 0.1.1 crate applies, so the test still exercises a real binary delta. Risk is low: the flag first shipped in oci-delta 0.3.1, which is what Fedora 44/45/46 ship, and the test is Fedora-only with F43 disabled. The only things to read closely are the wording of the new comment and the memory figure in the commit message and PR body (CI's anon-rss is 3.47 GiB, not 3.6G).
Hotspots
- note · logic —
tmt/tests/booted/test-switch-from-delta.nu:61-68(1a2fa13): Accurate overall, but one []int comes from bsdiff() and the other from qsufsort, so it is not only qsufsort. Rollsums are used only when more than 20% of the blocks match (diff.go generateForFile); otherwise the UKI is copied whole. The test would still pass in that case, just with a much larger delta.
Safe to skim
tmt/tests/booted/test-switch-from-delta.nu:25-26: Constant used once, in the oci-delta call it documents
1a2fa13 to
7fe111d
Compare
|
Applied the wording fixes from both reviews in 7fe111d: the code comment now credits bsdiff and qsufsort and says the UKI goes through rollsums, and the commit message and body give CI's killed process as 3.5 GiB (3641696 kB) instead of 3.6G. Comment and message text only, so the devspace runs at 1a2fa13 still apply. Generated-by: https://github.com/jmarrero-bot#llms |
|
/promote |
plan-51-switch-from-delta can fail on composefs UKI with oci-delta create "terminated by SIGKILL": the kernel OOM-kills it in the 4G test VM, which has no swap. The target image rebuilds the UKI (~120 MiB), which is under oci-delta's default 192 MiB bsdiff limit, and tar-diff's bsdiff keeps two int arrays the size of the old file. In the test VM that puts oci-delta at 2.3-2.4 GiB of anonymous memory, and it was at 3.5 GiB when it was killed in CI; how far above the live set it goes is down to GC timing. Capping bsdiff at 64 MiB makes oci-delta use rollsums for the UKI instead. That brings its peak down to about 130 MiB and its run time from ~170 to ~70 seconds, while the delta stays about the same size (3.35 vs 3.42 MB), so the test still applies a real binary delta. --jobs 1 does not help: only one layer has large files. Generated-by: AI Signed-off-by: Joseph Marrero Corchado <[email protected]>
7fe111d to
0379d6f
Compare
|
Signed off 1 commit(s) with |
0379d6f to
555d9c2
Compare
|
Opened upstream as bootc-dev#2635. Closing this review draft. |
plan-51-switch-from-delta can fail on composefs UKI with
oci-delta create"terminated by SIGKILL" (seen on bootc-dev#2623). The guest kernel OOM-kills oci-delta in the 4G test VM, which has no swap: the rebuilt UKI (~122 MiB) is under oci-delta's default 192 MiB bsdiff limit, and tar-diff's bsdiff needs ~16 bytes per byte of the old file. Capping bsdiff at 64 MiB in the test makes oci-delta use rollsums for the UKI, with a delta of about the same size.Testing, on a 16-core RHEL 10 devspace, image built like CI's fedora-44 composefs xfs systemd uki unsealed job, plan in bcvk's default 4G/2 vCPU VM:
--max-bsdiff-size 64at 100-140 MiB, in ~72 s instead of ~170 s, and the delta is 3.35 MB instead of 3.42 MB.--jobs 1doesn't lower the peak.GOGC=200in the test environment, main failed 2/2 exactly like CI and this branch passed 2/2. Even withGOGC=offoci-delta stays at 1.07 GiB with the cap.Measurements and run details: https://gist.github.com/jmarrero-bot/cef85960bc80160278b2440ebb86d112
Related: bootc-dev#2623
Generated-by: https://github.com/jmarrero-bot#llms
Review draft in jmarrero-forge, not upstream yet. This section is removed when the PR is opened upstream.
bootc-dev/bootc, basemainPVTI_lADOFBIZ7c4BlZPrzhGl-zUTo review:
/promoteon a line of its own, to open it upstream, ready for review. Either covers only the commits pushed so far.Signed-off-by: Joseph Marrero Corchado <[email protected]>to the commits lacking it (the bot's and yours; anyone else's only if you ask), with you as committer./draftline (in the same comment or before) to open it upstream as a draft (/readyundoes that).Bot run: session 77cad178, agent a52e51aa · claude-opus-5-5 22.3M in (89% cached) / 66k out · ~$17.07 inference + ~$5.26 compute (est., list prices) · 2h 10m wall · 33.4 core-h, Actions run 42239475447