Repository navigation
fix(ci): reconcile delayed Coverage UT worker metadata - #495
Conversation
|
鹏哥 @XuPeng-SH,麻烦先 review 这份 Coverage UT 放行修复( |
XuPeng-SH
left a comment
There was a problem hiding this comment.
目前同一 worker 的元数据尚未就绪时,派发和准入两端仍有两个时序缺口,会让随后恢复的 worker 无法完成 Coverage。两项均可通过确定性的模拟复现;请补齐下面的边界和对应测试。
| child_meta(r, t, pool, revision) | ||
| except WorkerIdentityPending: | ||
| pass | ||
| reconcile_child_meta(r, t, pool, revision, wait_for_display_title=(r == returned_id)) |
There was a problem hiding this comment.
[P2] 后续首次读取 attempt-jobs 仍会因短暂 404 直接失败
这里仅在 child_meta 内重试。当前 MatrixOne 的 worker 使用完整 display_title 时,child_meta 可以不读取 jobs 就成功;随后 select_cs -> observe 首次读取同一个 /attempts/1/jobs,如果此时尚未索引、返回 404,异常会直接退出 selector,即使下一次读取已经成功也不会发出 grant。基于当前代码的模拟可以复现,base 也存在此缺口。建议在现有有界等待内覆盖该读取,继续只操作同一个已核验 worker,保持严格身份校验和不重复派发;补一个完整的 dispatch → observe 测试,覆盖首读 404、后续成功及持续失败。
| parent_meta(t) | ||
| check(re.fullmatch("[a-f0-9]{40}", t["revision"]), "invalid dispatch revision") | ||
| for _ in range(12): | ||
| for poll in range(WORKER_IDENTITY_POLLS): |
There was a problem hiding this comment.
[P2] worker 的身份等待可能早于 selector 的重试结束
selector 最多读取 24 次,间隔 5 秒,约等待 115 秒;这里最多读取 12 次,约等待 55 秒。若 worker 较快启动,而同一个 run 的身份信息在 55 秒后、115 秒内才可用,worker 会先以 worker identity is unavailable 退出;selector 随后仍能接受该 run,但看到 worker 已失败后会以 not a queue timeout 退出。这个等待窗口差异原先就存在,本次扩大了双方可重试的元数据类型后仍会使可恢复的这类情况失败。建议对齐双方有界等待的生命周期,并持续验证父 selector 状态;添加交错测试覆盖 worker 先启动、元数据在两个期限之间恢复,以及父 selector 确认失败的情况。
|
鹏哥 @XuPeng-SH,两条评审意见已修到
106 项定向测试和 MatrixOne #33176 的配套契约模拟通过,新提交的 GitHub 检查也已通过。没有动 #33176 或重跑业务 PR。 |
XuPeng-SH
left a comment
There was a problem hiding this comment.
已复审 7dd526a。上轮两项均已验证修复:首次 attempt-jobs 404 现在共用派发的重试窗口,worker 也能等待晚到的身份和 grant。请修复下面这条新发现的准入回归。
| except OSError as error: | ||
| # This probe can stop an ungranted worker, never authorize it. If | ||
| # metadata is lagging, keep checking the grant at its normal cadence. | ||
| return max(GRANT_SELECTOR_POLL_SECONDS, admission_read_delay(error)) |
There was a problem hiding this comment.
[P2] selector 状态查询遇到二级限流会让有效 worker 提前退出
这里调用 admission_read_delay(),当 GitHub 返回二级限流的 403、没有 Retry-After 且 X-RateLimit-Remaining 大于 0 时,异常会直接退出 admit()。这是 GitHub 明确记录的响应形式。本地用相同的模拟输入对比:selector 查询在前 60 秒返回该响应,第 60 秒 grant 可用且 selector 正常。base 在第 60 秒通过全部准入校验,当前 head 在第 0 秒以 HTTP 403 退出。
请让这次辅助查询按限流退避,并在既有期限内继续等待,只有确认本组 selector 失败才由该查询提前终止 worker。保留 checkout 前的强制 selector 校验。补一个先限流、后恢复并取得有效 grant 的回归测试。
|
鹏哥 @XuPeng-SH,这条准入回归已修到 模拟覆盖了限流后取得有效 grant、退避期间不继续请求、持续限流到期限,以及强制核验仍被拒绝。108 项定向测试、配套契约模拟和 GitHub 检查已通过。 |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review of 84416ac04f9960a65db5d77b5baa286831cf756a: two admission reliability issues remain. The current selector cooldown does not cover the following parent metadata read, and nested metadata reads can overrun the admission deadline. The focused identity/admission unit tests (34) and nine failure-status cases passed. The matching Check Yaml run passed; a real two-group Coverage run was not exercised.
| delay, cooldown = check_grant_selector(t) | ||
| if cooldown: | ||
| selector_backoff = max(delay, interval, selector_backoff * 2) | ||
| interval = delay = selector_backoff |
There was a problem hiding this comment.
[P2] Apply the secondary-limit backoff to the follow-up parent metadata read. After this wait, the next parent_meta() call can still receive the same secondary-limit 403 (no Retry-After, remaining quota nonzero) and abort before the next backoff. A mock that recovers at 75s and then exposes the grant admits on base at 80s, but this head exits on the parent read at 60s. Cover consecutive limits across both reads within the admission deadline, preserve immediate failure for permission errors, and keep the mandatory selector check after grant.
| if poll + 1 == ADMISSION_ARTIFACT_POLLS or time.monotonic() + delay > deadline: | ||
| raise ValueError("parent admission artifact read unavailable; no PR code executed") from None | ||
| time.sleep(delay) | ||
| parent_meta(t) |
There was a problem hiding this comment.
[P2] Share the absolute admission deadline with nested reads. This parent_meta() call has its own wait, and the next artifact request can start after the outer deadline. With a transient artifact failure at 1,130s and three 25s metadata requests, the modeled next artifact request starts at 1,210s, beyond both the 1,140s admission budget and the 1,200s workflow step timeout. Pass the remaining budget to nested requests and waits, recheck it before additional I/O, and cover slow parent/selector reads near the deadline.
XuPeng-SH
left a comment
There was a problem hiding this comment.
复审 929ca74,此前五条评审意见对应的场景均已闭环。首次 jobs 404 和晚到身份通过原派发路径恢复,准入共享绝对期限,连续限流退避递增,成功读取后清零。退避后会重新核验本组 selector,权限错误仍拒绝准入。失败报告保留首发原因,成功仍需要完整证据。
本地 Linux 113 项定向测试、该提交的 GitHub workflow 检查,以及 MatrixOne #33176 配套契约模拟通过。真实双组 Coverage 留待更新 pin 后验证。
## What type of PR is this? - [x] Test and CI ## Which issue(s) this PR fixes: Related to #33358. ## What this PR does / why we need it: Pin the Coverage UT coordinator and both standby workers to the merged fix in matrixorigin/CI#495 (`4972bd963f4cc9510266323b14446a8edcda2bfc`). When a newly dispatched worker briefly returns HTTP 404 or its title has not been indexed, the coordinator re-reads the same run within its existing budget and still requires the complete worker identity before granting admission. Both failure paths were observed in [the Coverage rerun for #32989](https://github.com/matrixorigin/matrixone/actions/runs/45938589770/attempts/3). This rollout updates the three references only. #33176 also contains these pins alongside its worker display and cleanup changes. - Local validation at `b089e42fd54d`: actionlint passed for both caller workflows, all three calls match the unchanged reusable workflow input and secret declarations, and `git diff --check` passed. - BVT: N/A for GitHub Actions workflow configuration. - Production verification after merge: start a fresh two-group Coverage UT run for an affected PR and confirm that both groups publish complete profiles and `CI Required` passes. The production coordinator and workers resolve the MatrixOne default branch. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
## What type of PR is this? - [x] Test and CI ## Which issue(s) this PR fixes: Rollout companion to #33247 (no issue closed by this PR). ## What this PR does / why we need it: - Targets `4.2-dev` and changes only `matrixone-ut-coverage` in `.github/workflows/entrypoint.yaml`. - Pins the standby Coverage UT workflow to `matrixorigin/CI@4972bd963f4cc9510266323b14446a8edcda2bfc` (matrixorigin/CI#495), opts in with `enable_4_2_dev: true`, and grants dispatch permissions only on this caller job. Preserves the existing BVT generation, UT/BVT jobs, and the CI workflow's trust and fallback checks. The shared worker was already updated in #33375. ### Rollout prerequisites - Keep this draft and do not merge before #33247 lands and the CI pin is confirmed to admit the merged fixture. The current #33247 head `0241f3c` includes an updated `pkg/fileservice/s3_fs_test.go` after syncing `4.2-dev`: blob `166f8a7c163aaaf27ea4e9294c15b5946cc801a3` is not in the release allowlist in `4972bd9`. That pin would currently route such heads to legacy. Preserve the exact-file gate and review the compatible fixture pin before rollout. ### Validation - Passed actionlint, git diff --check, and a structural YAML comparison verifying that only the Coverage UT caller changed. - After the prerequisite is resolved and the rollout is active, validate one real PR targeting `4.2-dev`: both Coverage UT groups should run on CS, and merged coverage should report to that PR's head. No four-site rerun.
What this fixes
Related to matrixorigin/matrixone#33358. In the 2026-11-27 audit, 22 of 34 failed production Coverage worker runs stopped before PR checkout at admission. The 19 on the current MatrixOne/CI pins all had a failed parent selector and skipped the grant step; the reported parent error was
dedicated worker identity mismatch. A finished child can report a missing grant many minutes after the parent failed. That is not a failing UT.Changes
PR identity, authorization, runner routing, queue budgets, UT commands, and coverage handoff are unchanged. No MatrixOne caller changes or workflow reruns in this PR.
Validation and rollout