Skip to content

tests: Cap oci-delta's bsdiff size in the switch-from-delta test - #2635

Open
jmarrero-bot wants to merge 1 commit into
bootc-dev:mainfrom
jmarrero-forge:bot/delta-test-memory
Open

jmarrero-bot wants to merge 1 commit into
bootc-dev:mainfrom
jmarrero-forge:bot/delta-test-memory

Conversation

@jmarrero-bot

Copy link
Copy Markdown
Contributor

plan-51-switch-from-delta can fail on composefs UKI with oci-delta create "terminated by SIGKILL" (seen on #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:

  • In the test VM, oci-delta peaks at 2.3-2.4 GiB of anonymous memory (CI's killed process was at 3.5 GiB); with --max-bsdiff-size 64 at 100-140 MiB, in ~72 s instead of ~170 s, and the delta is 3.35 MB instead of 3.42 MB. --jobs 1 doesn't lower the peak.
  • The failure is rare on main (10/10 plan runs passed, in CI this is the only oci-delta SIGKILL in this job since 2026-10-14) because how far the Go heap overshoots depends on GC timing. With GOGC=200 in the test environment, main failed 2/2 exactly like CI and this branch passed 2/2. Even with GOGC=off oci-delta stays at 1.07 GiB with the cap.
  • This branch: plan-51-switch-from-delta passed 4/4 at 1a2fa13, which differs from the current head only in comment wording (plus 8/8 at an earlier revision, also differing only in a comment).

Measurements and run details: https://gist.github.com/jmarrero-bot/cef85960bc80160278b2440ebb86d112

Related: #2623

The Signed-off-by: Joseph Marrero Corchado <jmarrero@redhat.com> on these commits was added on jmarrero's approval of the review draft: jmarrero-forge#13 (comment)

Generated-by: https://github.com/jmarrero-bot#llms

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 <jmarrero@redhat.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant