Repository navigation
Recover PR UT Coverage when a selected runner pool stalls - #508
Conversation
|
我认同 #508 让两组 UT 直接进父流程、去掉子流程派发和轮询的简化。上线前有几个点想确认:
如果验收要求是哪里有余量就优先派到哪里,可以继续用 CI #506 这条路线作为备选:派发前并行查四站,最多 15 秒;优先把两组直派到不同的有余量池,只有一个可用池时另一组走共享队列。直派约 30 秒没拿到,先确认原预约已结束再回 CS 共享队列,已分配的组不动,上海 1 小时兜底保留。余量是快照,不是锁定名额;缺数据也不会阻断派发。建议等 #508 的共享标签验通,再决定是否替代 #506 的直派方案。 |
|
复审 [P2] 首派池在容量快照之后失去余量,已排队的组没有自动回退。 选池逻辑会选具体的 scale set;首次运行的 建议加一轮受控验证:先让快照选中 MTY,再让这个临时池接不住,同时保持另一 CS 池可接。明确这一场景是接受继续等或人工重跑,还是要求对尚未分配的组做有界回退;已经开始跑的组应保持不动。上海是否可以在首次派发时接单、不再保留 1 小时兜底,也请作为独立的上线策略确认。 |
|
[P2] 交接时不要撤掉已经分配 runner、但 job 状态还没更新的预约。 在
本地模拟输出: 代码在宽限结束后只接受 |
e11d3ef to
6f00d6d
Compare
## What type of PR is this? - [ ] API-change - [ ] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Related to #33416. ## What this PR does / why we need it: Merging this PR enables capacity-aware UT Coverage for eligible PRs targeting **both `main` and `4.2-dev`**. GitHub loads the `pull_request_target` entrypoint from `main` for both targets. The release target must pass its own S3 fixture check. The shared entrypoint, workers and contract pin `d1dd33c68b25d1c57f0b4d154de98a6f9dbc711d`. The scheduler can move a stalled reservation to another CS pool and use Shanghai when it confirms insufficient CS capacity. [CI #508](matrixorigin/CI#508) **Live progress during rollout.** An older parent running a new Shanghai worker can still display “preparing Coverage UT” while tests are running. Open `GROUP0` or `GROUP1`, expand `Wait for selected group, including its UT result`, and follow the URL after `open worker for live UT logs`. Open the worker job and its `Run coverage unit tests` step for live output. The parent propagates the worker’s terminal result. [Example of the worker link in a parent log](https://github.com/matrixorigin/matrixone/actions/runs/46298015015/job/141456512207) **Validation.** Replayed the authorization receipts and file metadata from a real PR for each target through the pinned selector. Both passed eligibility from the default-branch workflow. The regression test detects an accidental main-only dispatch or using the workflow ref as the PR target. All 89 MatrixOne CI contract tests and 153 companion tests passed locally. The cross-version replay covered 86 admissions and matched both groups’ profile and skip-manifest names. [Main sample](https://github.com/matrixorigin/matrixone/actions/runs/46365162091) · [4.2-dev sample](https://github.com/matrixorigin/matrixone/actions/runs/46364527877) **After merge.** Check one newly triggered eligible PR per target. Confirm that each parent references `coverage-ut.yaml@d1dd33c`, both groups report their assigned runners and UT results, and a successful parent collects both profiles and skip manifests and publishes the combined coverage profile.
Goal
Use spare CS capacity for MatrixOne
mainand4.2-devUT Coverage. The hosted preflight reads four sites in parallel under a 15-second budget. Two observed idle runners can take work through the shared CS label. Otherwise the two groups divide the verified online and cold slots. With one verified slot for two groups at initial placement, group 0 takes CS and group 1 can use Shanghai. An incomplete inventory can still supply CS offers. Unmatched groups keep the shared queue. Read-only capacity setupCold capacity accounts for CPU, memory, Pod limits, pending ARC demand and space for a whole DirectPV work volume. The collector overlaps the two ARC set lists and reads each site’s storage inventory alongside its nodes and Pods. It gives slower online observations six seconds when two cold sites are already available. A removed host counts as exhausted only when ARC also confirms no spare registered runner. Incomplete reads and ambiguous cache-node identities keep the shared CS fallback available. Each group owns one reservation, including on the shared path. This costs one initial child dispatch per group, admission polling and artifact transfer.
Any preflight label older than three minutes is refreshed before dispatch. The first queue recheck is at three minutes for an exact pool and five minutes for the shared label. A group already at its selected site keeps its place during the initial five-minute window. A stalled reservation can then try another CS pool. If only one CS slot remains and the pool previously selected for the sibling shows startup progress, the waiting group can take that slot. The selector retains this hint only for its current reservation. When the startup is at an unrelated pool, Shanghai can serve the overflow group. A lone group prefers available CS capacity. The sibling grant lookup is needed only when it changes the route.
A healthy bound runner gets time to register on a cordoned node or a node with a new
NoScheduletaint. Backoff, an unhealthy node and an untoleratedNoExecutetaint end that protection. After a handoff from an exact CS pool, a replacement with feasible startup demand has up to 30 minutes from its own dispatch before another verified cold slot can take over. A ready alternative can take over at a checkpoint.Each group can try up to four placements within the original 84-minute queue budget. While another placement is possible, the selector rechecks capacity every five minutes after the initial startup window. A live reservation keeps its place when no alternative is confirmed. On long waits, GitHub assignment polling backs off to one minute with a final check before expiry. A failed-only rerun first confirms that its previous grants are terminal, then takes a fresh capacity snapshot. Selection and waiting for UT completion share the original six-hour hosted job limit. A handoff checks assignment and a current destination before cancellation. A rejected cancellation gets a fresh placement check. Repeated definite rejections keep the current reservation. After confirmed withdrawal, a fresh inventory can select the released pool again. When a worker itself ends before admission, its pool can fill demand left over after the other CS pools. The selector checks the parent after choosing the destination and refreshes an expired offer once. A second expiry uses the shared CS queue. A dispatch that GitHub positively rejects also reselects after the cooldown. Only accepted placements count towards the limit. The selector rechecks the parent before publishing one grant. Metadata cooldowns for accepted workers resume on the same reservation and count against the queue budget. Both sites report the same UT step and support checkout with the workflow token.
Verification
bb01b2ban isolated Actions exercise exposed one pool from live CS inventory. The firstcs-mnl2-nc-n0-pr-v1worker deliberately failed before admission. Its replacement ran on another runner in that pool and produced sample coverage with the only grant. A replay of 83 historical assignments preserved grant times and GitHub request counts. Exercise · Replacement · PR checks6f00d6donto CIfbe329e. The shared CS/Shanghai worker now pins the wheel-cache action adopted by ci: use the prewarmed Python UDF cache in IDC Coverage #511. Linux amd64 with Python 3.12 installed and imported the locked PyArrow 24.0.0 both offline from the runner cache and from the package index when the cache was absent. The selector and capacity code in both isolated runs below are identical to the rebased head. Rebased workflow validation29fa1ffan isolated run injected a 429 on the proposed JED dispatch and observed another site with live CS capacity. GitHub accepted onecs-mty-nc-n1-pr-v1worker. Its grant and sample coverage profile matched. Selector · Workere11d3efa separate drill held the first assignment observation at queued and made the alternative offer expire. GitHub confirmed the first child was cancelled. Fresh CS inventory showed room on the releasedcs-mnl2-nc-n1-pr-v1pool, where a second worker received the only grant and produced the sample coverage profile. Selector · Worker808163dinto a cold MTY grant at 82m30s. Reusing a recovered cold pool reduced 11m25s to 5m50s. Replaying 83 historical assignments preserved grant times and GitHub request counts. Linux scripts passed 252 tests with three existing expected failures, and the 173 focused macOS tests passed.808163dan isolated selector refreshed a 12-minute-old shared label using live CS inventory. The drill held the job observation at queued, injected one rejected cancellation (HTTP 429, 2-second cooldown), and withdrew the alternative offer. The originalcs-mty-nc-n1-pr-v1worker received the group's only grant. GitHub recorded one child and the sample job succeeded. Selector · CS worker808163dthe Linux suite passed 250 tests with three existing expected failures. In a replay with all 11 CS pools observed, refreshing the old shared decision changed time to grant from 6m30s to 1m30s. Revalidating a rejected cancellation preserved JED and changed 7m30s to 4m30s. The 83 historical assignment samples retained their grant times and GitHub request counts. PR workflow validation1f722b1a live exercise completed two withdrawals and granted the replacement. The isolated harness kept two test reservations queued and supplied a stuck ARC startup observation. It replaced the 30-minute registration window with 120 seconds. GitHub confirmed both cancellations in sequence, then group 1 acquiredcs-ruh-nc-n2-pr-v1and group 0 acquiredcs-mty-nc-n1-pr-v1. The replacement was held for 139.3 seconds. Each group published one grant and the two sample coverage profiles merged. GitHub-hosted jobs also queued independently of CS capacity. The inventory job queued for 11m31s and the final merge queued for 24m21s before running for 24 seconds. Controlled handoff · Merged sample1f722b1the isolated MatrixOne Actions run used the exact collector and worker pool checks. Both sampled jobs took real capacity, group 0 oncs-mnl2-nc-n1-pr-v1in 13 seconds and group 1 oncs-mty-nc-n1-pr-v1in 10 seconds, measured from job creation to start. The hosted inventory job itself queued for 101 seconds and its collector took 8.83 seconds. Native placement51450fband this revision both admitted all 83. The earlier PR head admitted 70. All 13 waits over 30 minutes eventually passed UT in production. The longest took 58m09s. Production sample1f722b1the Linux scripts suite passed 248 tests with three existing expected failures. An independent allocation check exercised 6,880 two-group decisions. PR workflow validation2bdb4cethe isolated Actions run read real capacity in two CS sites. The harness held group 0's grant, forced group 1's first reservation to stay queued and injected the capacity transition using 30- and 60-second checkpoints. Group 1 cancelled its JED reservation, ran oncs-ruh-nc-n0-pr-v1and received its grant before group 0 dispatched. Group 0 then ran oncs-mty-nc-n1-pr-v1. Each group got one grant and both sample profiles merged. Run · Group 1 · Group 0 · Merged profileaee326fthe same slow-start replay reached the 30-minute deadline. Two groups already on different single-slot sites both acquired runners at 3m30s in five replays, with zero withdrawals or sibling reads. Onaee326fthe slower group took 6m30s. Cordoning a healthy node preserved the same four-minute registration. With a third-party startup, the groups used CS and Shanghai when their common pool failed before or after the first checkpoint.2bdb4cethe Linux scripts suite passed 244 tests with three existing expected failures. All 165 focused tests passed on macOS. An independent allocation check covered 30,096 first-checkpoint decisions with overlapping or distinct held pools, partial inventories, cold slots and idle runners. PR workflow validationRollout
Update the MatrixOne dispatch endpoint on
mainto the common CI worker and update both protected caller pins. The endpoint must understand exact CS pool labels before the callers start issuing them. The final canary used an isolated MatrixOne branch. Production still uses its current pins.