Repository navigation
Det Sweep: Db2 shards restore the pinned Db2's first start instead of repeating it (Part of #5882) - #5950
Conversation
…of repeating it (Part of #5882) Each Db2 shard started the pinned image from scratch: instance setup, then one CREATE DATABASE after another for its pool (run 39696713590: first database after 135-180 s, all after 302-440 s; 220 Db2 shard jobs on 10-21). tests/tools/db2_snapshot.py keeps that first start: the container's changes over the pinned image (docker diff, ~40 MB, no deletions) and its /database volume (the instance, GGDB..GGDB3 empty), keyed by the image digest and equivalence_db2.py. A shard restores it onto the pinned image before the prewarm (equivalence_db2.run_args: the same container, plus the volume); a miss or a failed restore starts Db2 as before. Main saves it, one shard, as the image (#5262), from a FRESH container, never one a case has used. Local, by hand: save 179 s; restore -> equivalence_db2 ready after 33 s, all four pool databases took a create/insert/query by 38 s (fresh: 146 s here). The timing row gains db2_snapshot (restored / fell back / not tried). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01E977ZMkfHVAsLSWrDLDaW5
|
No description provided. |
|
PR #5950 @ dd9dfa6: 1 failed check(s) == shepherd (label event) (failure) -- real |
Part of #5882 (CI speed).
Problem: on 10-21, 220 Db2 shard jobs used 57.5 runner-h, about half of Det Sweep. Each started the pinned Db2 image from scratch: instance setup, then a
CREATE DATABASEfor each pool database, one at a time. In run 39696713590 the first database was ready after 135-180 s and all of them after 302-440 s. The ~200-270 s of setup per shard is ~25% of that run's job time.What it does:
tests/tools/db2_snapshot.py(key | save | restore), modelled ondb2_image_cache.py.savestarts a fresh container of the pinned image (never one a case has used, which would carry its tables) and creates GGDB..GGDB3 exactly asequivalence_db2does. It then stops Db2 cleanly and keeps two tars: the container's changes over the pinned image (docker diff: ~400 paths, ~40 MB, no deletions, tarred as root so owners are kept) and the/databasevolume.restoremakes the containerequivalence_db2runs, from the pinned image, with that volume and delta, and starts it.equivalence_db2then waits for it as for any container. No snapshot, another key, another image, or any failure: it leaves nothing behind and Db2 starts as before.equivalence_db2.run_args(): the container's options in one list, so the restored container is the started one plus-v <volume>:/database. Pinned by a test.det-sweep.ymldb2job:db2-snapshot-<digest>-<sha of equivalence_db2.py>-pool4) next to the image'srestoreonce the image is loaded, then continues as todaydb2_snapshot(true restored / false fell back / null not tried).Checked, locally by hand (own container names; the shared
gitgalaxy-db2untouched):save179 srestore:equivalence_db2._ensure_container()ready after 33 s, and all 4 pool databases took a create / insert / query by 38 sExpected on CI: all pool databases in roughly 50-70 s instead of 302-440 s, so ~3-6 min less per Db2 shard. That's ~10 runner-h/day at 10-21 volumes, and Db2 shards start proving sooner.
Owner check: this is still the real, digest-pinned Db2 (the standing "real Db2" decision). The databases are the same empty databases made by the same commands; they are just made once per key instead of once per shard.
To seed after merge: a
workflow_dispatchof Det Sweep on main, or the next nightly (04:41 UTC), makes the entry. Until then every shard falls back to today's start.🤖 Generated with Claude Code