Repository navigation
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
76d9e35 to
2d5ce73
Compare
|
Current head |
## 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 #28419 (CI Required / coverage failure reporting) Related to #27291 and #27293 through #28529's CI startup blocker ## What this PR does / why we need it: `pull_request_target` currently checks out `.github/ci` from the pull request base SHA in the `change-scope` and `ci-required` jobs. A `4.2-dev` pull request can therefore load a workflow that references `change-scope.cjs` while its base commit does not contain that helper, failing before product tests start with `Cannot find module '.github/ci/change-scope.cjs'`. Both jobs now load the repository-owned CI helper from `${{ github.workflow_sha }}`, the commit that supplied the running workflow. The PR base and head SHAs remain event metadata only, and all checkout credentials remain disabled. A checkout-independent provenance step writes the workflow, base, and head SHAs before loading the helper, so missing-helper or checkout failures retain diagnostics. No test routing, required-check policy, or product code is changed. The existing `3.0-dev` route and failure semantics remain unchanged. This PR is intentionally separate from #28591, whose purpose is cancelling doomed PR runs. ## Validation - Baseline red check: the old workflow fails the trusted workflow-SHA checkout contract. - `node --test .github/ci/change-scope.test.cjs` (10/10 passed) - The fixture parses the actual checkout configuration for both jobs, resolves the event expressions against separate base/workflow/head trees, and executes the selected workflow helper. The base tree lacks the helper, the workflow tree contains the trusted classifier and verifier, and the head tree contains a malicious same-name helper. Both jobs select the workflow tree; the classifier and `verifyResults` are executed from that same trusted version. - The contract test rejects a floating `main` ref, requires provenance before checkout, and executes the provenance shell against a simulated checkout failure to verify the summary remains available. - `actionlint v1.7.12 .github/workflows/entrypoint.yaml` (passed) - `git diff --check` (passed) - The first CI run was correctly blocked by an invalid PR reference to #28529 (a PR, not an issue). The body now references valid issues #28419, #27291, and #27293. - After this PR merges, GitHub's `pull_request_target` behavior uses the repository default-branch workflow source; a fresh #28529 run can therefore be created directly without a `4.2-dev` CI-file backport. That run must prove the workflow SHA contains this fix, classification succeeds, and required tests actually start. See [GitHub's change](https://github.blog/changelog/2025-11-07-actions-pull_request_target-and-environment-branch-protections-changes/). QA required: no; this is a workflow/test-only change and does not alter MatrixOne runtime behavior. Complete CI startup and classification validation is a post-merge check. --------- Co-authored-by: XuPeng-SH <[email protected]>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
iamlinjunhong
left a comment
There was a problem hiding this comment.
审查范围:当前 head c198714fae55dce5c2f782e18b9eb01486f12ced,基线 4.2-dev@b122da6dc20985cbfcb2fcc642ae6729d70d8516;已核对完整 7 文件 diff、相关调用链、测试、上一轮 review/thread 及 PR conversation。
结论:当前未发现 P0/P1。上一轮提出的 P1(空 range-end 误接纳 enclosing live range)已由当前 findStructuralRangePair / hasFollowingRangePairLocked 的对称检查修复,TestEmptyRangeEndDoesNotSpliceEnclosingLiveRange 通过。
[P2] pkg/lockservice/lock_table_local.go:1323:mergeContext.restart 仅执行 c.mergedWaiters = c.mergedWaiters[:0],没有清空 backing slots。当 range scan 已通过 mergeWaiter 暂存一个或多个 waiter queue、随后命中 errEmptyLock 时会走此路径;mergeContext 随后经 defer mc.close() 回收到 sync.Pool,旧 slot 仍持有 waiter-queue 引用及其历史 backing capacity。重复 stale-empty 重试或高 waiter 数场景会因此延长这些对象/内存的保留时间,直到 pooled context 被覆盖或回收;close 的同样 reslice 也会保留该引用。建议在缩短切片前 clear,并增加 backing slot 已清空的回归断言。
验证:go test ./pkg/lockservice -count=1、目标 -race 测试、go list -mod=readonly、go vet -mod=readonly 和 git diff --check 通过。lockop 目标测试受环境缺少 roaring.h、xxhash.h、usearch.h 等本地原生头文件阻塞,未据此宣称通过。
按“仅有 P2、首次 review”规则,本次事件为 COMMENT。
aunjgr
left a comment
There was a problem hiding this comment.
Reviewed revision: c198714fae55dce5c2f782e18b9eb01486f12ced.
Independent review against 4.2-dev: no blocking finding. Checked all tryHold callers, current-entry identity validation before pooled-state access, paired/orphan/enclosing range cleanup, rollback of speculative waiter references before rescan, and real unlock/admission regressions. Also checked the LockOp default version checker and independent shared targets.
Reused exact-head CI run 34833159607. Older local pending-validation statements in the PR body are not treated as current CI failures. The separately scoped departed-owner/CN-replacement changes are not required by this approval.
XuPeng-SH
left a comment
There was a problem hiding this comment.
GPT-6 medium deep review at exact head c198714.
P1 — multiple orphan range ends can leave pooled live state reachable after owner unlock. In pkg/lockservice/lock_table_local.go:1270–1278, consider a live range [1,10] plus empty orphan ends at 5 and 7. Cleanup of 5 finds start 1, while the pairing scan stops at orphan 7 and fails to find the real end 10; recovery then creates end 5 using the live range's backing state. Cleanup of 7 removes only 7. The owner's normal unlock removes 1 and 10 and returns the backing state to pools, but key 5 remains in the store pointing at that returned state. Extend the regression to clean both orphan ends and then perform normal owner unlock; pairing must prove the predecessor state has no surviving counterpart before adopting it.
The exact-head CI is green. The published artifact does not provide per-test timing for the new cases, so the 45-second limit is not certified.
|
Addressed the latest lifecycle findings on head
Local validation on this exact head:
The pushed CI run is |
|
Re-review request for current head The P1 orphan-end repair is implemented in Exact-head local validation passed:
The current PR still has pending CI and the 45-second per-test timing requirement has not been certified by this local run. Please re-review the repaired P1 at the current head. |
|
CI follow-up for exact head Run |
|
CI correction for the latest attempt of run 34920860184: Ubuntu UT job 104273461158 failed during reusable-workflow secret evaluation before any runner step or test started (missing EE_DB_* inputs; runner_id=0 / BlobNotFound). CI Required job 104273469317 is derived from that setup failure. The earlier note attributing this attempt to TestCheckLeaseFailed is superseded. No product-code change or blind rerun was made; the CI owner must restore the required secret inputs and rerun only the failed job. The formal review gate remains CHANGES_REQUESTED for XuPeng-SH re-review of head 7efb318. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
GPT-6 medium deep review at exact head c6927c2.
P1 — mixed orphan endpoints can retain live pooled state after the range owner is unlocked. In pkg/lockservice/lock_table_local.go:1267-1268, using the PR stale-endpoint cleanup model with Start(1)->End(10) as the live range and orphan End(5), Start(7), cleanup can copy the same live holder into both orphan entries. The normal owner Unlock then removes keys 1 and 10 and returns that holder to the global pools, while keys 5 and 7 still reference it.
Consequence: store entries outlive holder ownership; pool reuse can make those entries access another lock's mutable state without its table mutex. The snapshot identity check does not prevent this because both snapshots are current when processed.
Please handle mixed end/start orphan sequences so a prospective counterpart cannot be an enclosing live range, and add a regression covering batch cleanup followed by normal owner unlock and an empty-store assertion. The current two-orphan-end regression does not cover this sequence.
|
Addressed XuPeng-SH's P1 review 5207128102 in Root cause: during batch cleanup, a live range Fix: Regression: added Validation: focused structural/cleanup tests PASS; the mixed regression passes |
XuPeng-SH
left a comment
There was a problem hiding this comment.
GPT-6 medium deep review at exact head 551700d\n\nP1 — Start-first cleanup can adopt an enclosing live range's pooled state.\n\nIn pkg/lockservice/lock_table_local.go:1228-1229, the backward scan stops at any preceding range-end, including an orphan. Concrete path: owner A has live [1,10], stale orphan End(5) and Start(7) exist; Lock(row 7) cleans Start(7), the backward scan stops at End(5), the forward scan accepts End(10), and repair copies its backing state into key 7. Retry sees A already owns that state, so no key 7 is recorded. Normal Unlock returns the state for keys 1 and 10 to the pool while key 7 still references it. Pool reuse can then expose another lock's mutable state through the wrong table mutex.\n\nRequired: prove the candidate end has no matching start and scan past orphan endpoints before adopting it. Add a regression using real Lock([1,10]), start-first cleanup through Lock(row 7), and owner Unlock; assert no surviving entry references returned state. Cover both cleanup orders, preserve genuinely unpaired-endpoint repair, and run focused race validation.\n\nExact-head CI passed, but this ownership counterexample remains.
|
Formal P1 repair is published at exact head The Start-first orphan sequence is closed: cleanup crosses unmatched The clean |
|
Correction to the previous |
XuPeng-SH
left a comment
There was a problem hiding this comment.
GPT-6 medium deep re-review APPROVE at exact head babbdc7\n\nAll changed hunks across eight files reviewed. Earlier orphan-endpoint ownership failures and pooled waiter-reference retention are resolved. Correctness, lifecycle, concurrency, liveness, boundedness, consumer, compatibility, and test closures were checked. Exact-head CI passed race UT, build/SCA, coverage, and active multi-CN BVT. No concrete blockers remain.
What type of PR is this?
Which issue(s) this PR fixes:
issue #27291
issue #27293
What this PR does / why we need it:
This is a focused backport of the merged upstream #27296 fix to
4.2-dev.A stale empty row/range lock can reach
tryHold. The old4.2-devpath panics (BUG: try hold on empty lock) and can leave the following admission blocked. This backport:errEmptyLockinstead of panicking;It also closes the empty-endpoint lifecycle hole in the batch cleanup path.
closeRangeWaiterLockedcan snapshot multiple empty endpoints before deleting them;deleteEmptyLockLockedre-reads the current store entry and verifies the value, creation timestamp, and backing holders/waiter identity before dereferencing or releasing state.The current formal P1 repair closes the remaining Start-first orphan sequence. For a live
[1,10]plus orphanEnd(5)andStart(7), structural cleanup now crosses an unmatched orphan end and rejects a candidateEndthat already has an earlier matchingStart. This prevents either cleanup order from copying the live pooled state into an orphan key. The regression uses realservice.Lock([1,10]), both Start-first and End-first cleanup orders, real ownerUnlock, returned-state traps, and an empty-store assertion.The companion remote-bind lifecycle fixes #28115 and #28343 are intentionally not included. They address departed-owner/CN-replacement fencing, require an adapted ordered backport, and were not established as the cause of this incident. They should be reviewed separately.
QA required: yes. This changes distributed LockService/CN failure and cleanup behavior; after merge it requires dev two-CN validation of the original panic path and post-cleanup admission.
Validation
matrixorigin/matrixone:4.2-devatb122da6dc20985cbfcb2fcc642ae6729d70d8516.babbdc7bdf0bedec18822a3f774fc48f21644e94.4196ac635372fa22eec6a7bab304d1cc43b239a569e82f4e869b12981e79df6a.a58df1faf1c94c16a9151454c6cf2caa8174bd19b3f16c6af184ab2fb032de82.551700dfad0ecf97d9f6acd2e4f66d6e5f74eb29because the orphan endpoint remained; the repaired head passes.-race -count=100PASS with 100 pass records and no race report../pkg/lockservicenormal: PASS (111.826s). Full./pkg/lockservice-race: PASS (115.861s).go list -mod=readonly ./pkg/lockservice ./pkg/sql/colexec/lockop: PASS.gofmtandgit diff --check: PASS.mo-cgo-testclean-worktree wrapper:BLOCKED_ENVIRONMENTbecause this candidate worktree lacksthirdparties/install. Controlled direct CGo execution with explicit native paths passed the lockservice normal/race tests.go build/go vetfor lockservice+lockop remain environment-blocked inpkg/common/docfilterby unavailableC.mo_cbitmap_*/C.mo_croaring_*bindings; no build/vet PASS is claimed.The PR does not modify GitOps/Kubernetes or deploy to dev. Full dev rollout and SQL validation remain post-merge QA gates.