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? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Blocking: please remove or correct fixes #26210 in the PR description before merge. Issue #26210 tracks the unresolved production Chaos/TPCC 20618 r-w conflict storm after killing a CN; this checkpoint-iterator patch does not address that incident. With the current closing keyword, merging this PR into main will automatically close that unrelated production issue and hide outstanding work.
The code change itself looks sound: iterator errors are propagated before the copy-on-write partition state is published or the subscription becomes Subscribed; normal EOF, callback errors, cleanup, and retry behavior are preserved. Local validation passed 10 repeated targeted runs, 5 race-enabled runs, and the dependent disttae subscription-consumption test.
|
Updated the PR description and removed the auto-closing keyword. The patch is scoped to checkpoint iterator error propagation. It was found while investigating #26210, but it does not prove that this defect resolves the complete post-CN-kill |
|
I re-evaluated the closing-keyword review against the incident-specific RCA rather than the issue body’s original, pre-RCA hypotheses.
I expanded the PR description and added the full root-cause update to #26210: #26210 (comment) This corrects my earlier overly conservative comment. The patch is not a generic r-w conflict mitigation; it removes the proven state-publication defect that generated this incident’s pathological conflicts. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Re-review after considering the latest PR and issue comments:
The code change itself is sound and I found no additional code blocker. The iterator error now exits before the copy-on-write PartitionState is published, before checkpointConsumed is set, and before the subscription advances to Subscribed; EOF, callback errors, cleanup, and retry behavior remain intact. Targeted race runs (10x), the dependent subscription-consumption test, and PR CI pass.
The closing-keyword blocker remains. The new RCA comment establishes a plausible code-level failure chain, but its direct validation proves only the generic iterator-error propagation defect. It does not provide direct incident evidence that this iterator path failed and published partial state during #26210, nor a same-topology chaos replay showing that this change eliminates the reported ~43-minute 20618 storm. In particular, the link from an incomplete CN object view to that incident’s 20618 burst is still an inference.
Please replace fixes #26210 with Refs #26210 and keep the incident open for replay verification, or provide direct incident/replay evidence sufficient to close it. No further code changes are requested.
|
I agree that the previous description only showed temporal correlation plus the generic iterator regression. I went back to the complete Loki history and correlated the incident at object and transaction granularity. The new evidence changes the assessment:
A correctly consumed post-merge checkpoint cannot expose those source objects. The affected loop is the concrete path that converts the checkpoint read/cancellation into success, publishes the partial state, and marks it subscribed. The iterator error itself cannot exist in historical logs because this bug discards it, and I added the full evidence and counts to the PR description and to the issue: #26210 (comment) Based on this object-level closure, I am retaining |
XuPeng-SH
left a comment
There was a problem hiding this comment.
No blocking findings on ae46ab5.
The added incident evidence resolves my earlier causality concern around fixes #26210: the exact CN/TN error-count match, the seven stale source objects deleted by MT-1299 and covered by the checkpoint, and the deadline at the lazy checkpoint-load boundary form a sufficiently specific production chain to the swallowed ObjectIter.Next() error.
The implementation now propagates iterator failures for both data and tombstone ranges. The downstream partition update is copy-on-write, so an error neither publishes partial state nor sets checkpointConsumed; subscription state likewise does not advance to Subscribed, preserving retry with a fresh context. EOF, callback errors, and iterator cleanup remain intact.
Verified locally on the exact head:
- focused regression under -race -count=5
- full pkg/vm/engine/tae/logtail package under -race
The PR checks currently reported by GitHub are green.
Merge Queue Status
This pull request spent 40 minutes 33 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonPull request #26233 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Tick the box to put this pull request back in the merge queue (same as
|
## Summary - Remove the obsolete post-merge MOC coverage-status workflow. The current coverage pipeline is self-contained and no longer creates the legacy MOC record this workflow expects. - Stabilize three user-level-lock cleanup tests by asserting durable terminal state instead of transient asynchronous-worker ownership/progress, and always reset shared test state on early assertion exit. - Add the read-only `mo-pr-radar` skill for deterministic PR review queues, conflict/CI/approval filters, request-changes freshness, and per-PR blocker explanations. Its review model uses each reviewer's latest opinionated review, so a later comment cannot erase an approval/change request and a later approval clears historical change requests. - Strengthen `mo-self-review` with exact affected-test selection, adaptive per-test race budgets, deterministic flake checks, and one complete owning-package race run. Zero/under-resolution JSON test durations safely use the adaptive ceiling. ## Validation - Confirmed the removed workflow runs only after a merged PR closes, is not a required check on main or 4.2-dev, and has no repository/Mergify references. - PR radar: 22 offline unit tests, Bash syntax checks, both skill validators, and live GitHub regressions: #25089 remains `CHANGES_REQUESTED` after a later comment; approved #26233 is absent from the stale-change queue. - Adaptive race measurements from `go test -json`, with `B=30s`: release-cleanup `T=0.07s, N=100`; timed-out cleanup `T=1.06s, N=28`; successful-probe cleanup `T=0.05s, N=100`. - Final focused race stress passed for all three exact tests (`-count=100/28/100`); matching non-race stress also passed. - Full `pkg/sql/plan/function` owning package passed with `-race -count=1`. - `go build` and `go vet` passed for `pkg/sql/plan/function`. - `git diff --check` passed after merging the latest main. Fixes #26262. Related to #26253.
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: fixes matrixorigin#26210 ## What this PR does / why we need it: After `task_kill_cn`, a replacement CN must rebuild table state by consuming the latest checkpoint before serving the subscription. `consumeCheckpointWithTableID` stopped its data and tombstone loops when `ObjectIter.Next()` returned an error, but discarded that error and returned nil. A context/FileService failure could therefore publish a partially reconstructed partition and finalize the table as `Subscribed`. ### Incident evidence for matrixorigin#26210 The production logs pin the reported storm to this failed-reconstruction shape rather than to ordinary TPCC contention: 1. At `17:25:22–17:25:44 UTC`, TN merge `MT-1299` compacted `bmsql_stock` and deleted its 18 source objects. The merge committed at `1785000344282453036-0`. 2. The ICKP covering `17:24:33–17:29:33 UTC` was completed at `17:31:58`, so it includes that merge deletion. A CN subscribing after this checkpoint must not serve rows from those source objects as live. 3. Replacement CN `mo-chaos-regression-dis-tp-cn-jndns` received the `bmsql_stock` subscription response at `17:32:15.660916` and logged `subscribe-ok` at `17:32:15.705894`. The triggering migrated `SELECT ... FROM bmsql_stock ... FOR UPDATE` prepare failed with `context deadline exceeded` at `17:32:15.707491`, immediately at the lazy checkpoint-consumption boundary. 4. The first reported `20618` at `17:32:55.368` is identified by TN as `TRANSFER-ERR`, `old-err=ExpectedEOB`, table `273124` (`bmsql_stock`). Its transaction ID maps back to CN `jndns`. 5. Full-window Loki counts match exactly: all **10,531** CN-side `r-w conflict` errors came from `jndns`, and TN logged exactly **10,531** `TRANSFER-ERR/ExpectedEOB` failures for table `273124`. 6. Those failures contain only 13 block-row IDs from seven objects. All seven are source objects deleted by the same `MT-1299` merge. Their TN transfer entries had already expired, which is why TN returned `ExpectedEOB`; a correctly rebuilt post-merge CN partition could not continue selecting those objects. 7. `task_kill_dn` started at `18:15:10`; the last conflict was at `18:15:13`. After logtail recovery, `jndns` subscribed `bmsql_stock` again with a new partition state at `18:16:23`, and the storm disappeared. The affected binary cannot emit the iterator error itself: `S3FS.Read` may return `ctx.Err()` before installing its event logger, `ObjectIter.Next()` returns that error, and the old loop then discards it. The observable production signature is consequently false `subscribe-ok` followed by a partition that still serves objects whose checkpointed merge deletion was not applied. The deterministic regression supplies the missing direct function-level proof: with an expired context, `ObjectIter.Next()` returns `context.DeadlineExceeded` while the affected `consumeCheckpointWithTableID` returns nil. ### Failure path 1. `ObjectIter.Next()` returns a context/FileService error from `ioutil.LoadColumnsData`. 2. The old loop exits without returning that error. 3. `Partition.ConsumeCheckpoints` receives nil, publishes the partially populated copy, and sets `checkpointConsumed=true`. 4. `loadAndConsumeLatestCkp` receives nil and advances the table to `Subscribed`. 5. The CN serves stale checkpoint objects. Updates using their row IDs reach TN after the merge transfer entries have expired, and `txnimpl/table.go` converts `TransferTable.Pin(...)=ExpectedEOB` into `20618 r-w conflict`. ### Fix This PR: - checks every data and tombstone iterator result explicitly and returns the original error; - prevents partial checkpoint state from being published or marked consumed; - prevents a failed initial load from becoming `Subscribed`, allowing retry with a fresh context; - preserves normal EOF, callback-error, and cleanup behavior; - adds real checkpoint/FileService coverage for successful consumption and data/tombstone iterator failures. There is no protocol, storage-format, RPC, locking, or normal-path I/O change. Legitimate r-w conflicts remain unchanged; this prevents the incomplete CN state that generated matrixorigin#26210’s pathological conflict storm. ## Testing - `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=5m ./pkg/vm/engine/tae/logtail` - `.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=10 -timeout=10m -run 'TestConsumeCheckpointWithTableID($|PropagatesIteratorError)' ./pkg/vm/engine/tae/logtail` - `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=10m ./pkg/vm/engine/disttae` - `go vet -mod=readonly ./pkg/vm/engine/tae/logtail` - `go build -mod=readonly ./pkg/vm/engine/tae/logtail ./pkg/vm/engine/disttae` - PR CI: UT, race-sensitive package tests, SCA, BVT, and coverage passed Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: fixes matrixorigin#26210 ## What this PR does / why we need it: After `task_kill_cn`, a replacement CN must rebuild table state by consuming the latest checkpoint before serving the subscription. `consumeCheckpointWithTableID` stopped its data and tombstone loops when `ObjectIter.Next()` returned an error, but discarded that error and returned nil. A context/FileService failure could therefore publish a partially reconstructed partition and finalize the table as `Subscribed`. ### Incident evidence for matrixorigin#26210 The production logs pin the reported storm to this failed-reconstruction shape rather than to ordinary TPCC contention: 1. At `17:25:22–17:25:44 UTC`, TN merge `MT-1299` compacted `bmsql_stock` and deleted its 18 source objects. The merge committed at `1785000344282453036-0`. 2. The ICKP covering `17:24:33–17:29:33 UTC` was completed at `17:31:58`, so it includes that merge deletion. A CN subscribing after this checkpoint must not serve rows from those source objects as live. 3. Replacement CN `mo-chaos-regression-dis-tp-cn-jndns` received the `bmsql_stock` subscription response at `17:32:15.660916` and logged `subscribe-ok` at `17:32:15.705894`. The triggering migrated `SELECT ... FROM bmsql_stock ... FOR UPDATE` prepare failed with `context deadline exceeded` at `17:32:15.707491`, immediately at the lazy checkpoint-consumption boundary. 4. The first reported `20618` at `17:32:55.368` is identified by TN as `TRANSFER-ERR`, `old-err=ExpectedEOB`, table `273124` (`bmsql_stock`). Its transaction ID maps back to CN `jndns`. 5. Full-window Loki counts match exactly: all **10,531** CN-side `r-w conflict` errors came from `jndns`, and TN logged exactly **10,531** `TRANSFER-ERR/ExpectedEOB` failures for table `273124`. 6. Those failures contain only 13 block-row IDs from seven objects. All seven are source objects deleted by the same `MT-1299` merge. Their TN transfer entries had already expired, which is why TN returned `ExpectedEOB`; a correctly rebuilt post-merge CN partition could not continue selecting those objects. 7. `task_kill_dn` started at `18:15:10`; the last conflict was at `18:15:13`. After logtail recovery, `jndns` subscribed `bmsql_stock` again with a new partition state at `18:16:23`, and the storm disappeared. The affected binary cannot emit the iterator error itself: `S3FS.Read` may return `ctx.Err()` before installing its event logger, `ObjectIter.Next()` returns that error, and the old loop then discards it. The observable production signature is consequently false `subscribe-ok` followed by a partition that still serves objects whose checkpointed merge deletion was not applied. The deterministic regression supplies the missing direct function-level proof: with an expired context, `ObjectIter.Next()` returns `context.DeadlineExceeded` while the affected `consumeCheckpointWithTableID` returns nil. ### Failure path 1. `ObjectIter.Next()` returns a context/FileService error from `ioutil.LoadColumnsData`. 2. The old loop exits without returning that error. 3. `Partition.ConsumeCheckpoints` receives nil, publishes the partially populated copy, and sets `checkpointConsumed=true`. 4. `loadAndConsumeLatestCkp` receives nil and advances the table to `Subscribed`. 5. The CN serves stale checkpoint objects. Updates using their row IDs reach TN after the merge transfer entries have expired, and `txnimpl/table.go` converts `TransferTable.Pin(...)=ExpectedEOB` into `20618 r-w conflict`. ### Fix This PR: - checks every data and tombstone iterator result explicitly and returns the original error; - prevents partial checkpoint state from being published or marked consumed; - prevents a failed initial load from becoming `Subscribed`, allowing retry with a fresh context; - preserves normal EOF, callback-error, and cleanup behavior; - adds real checkpoint/FileService coverage for successful consumption and data/tombstone iterator failures. There is no protocol, storage-format, RPC, locking, or normal-path I/O change. Legitimate r-w conflicts remain unchanged; this prevents the incomplete CN state that generated matrixorigin#26210’s pathological conflict storm. ## Testing - `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=5m ./pkg/vm/engine/tae/logtail` - `.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=10 -timeout=10m -run 'TestConsumeCheckpointWithTableID($|PropagatesIteratorError)' ./pkg/vm/engine/tae/logtail` - `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=10m ./pkg/vm/engine/disttae` - `go vet -mod=readonly ./pkg/vm/engine/tae/logtail` - `go build -mod=readonly ./pkg/vm/engine/tae/logtail ./pkg/vm/engine/disttae` - PR CI: UT, race-sensitive package tests, SCA, BVT, and coverage passed Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
## Summary - Remove the obsolete post-merge MOC coverage-status workflow. The current coverage pipeline is self-contained and no longer creates the legacy MOC record this workflow expects. - Stabilize three user-level-lock cleanup tests by asserting durable terminal state instead of transient asynchronous-worker ownership/progress, and always reset shared test state on early assertion exit. - Add the read-only `mo-pr-radar` skill for deterministic PR review queues, conflict/CI/approval filters, request-changes freshness, and per-PR blocker explanations. Its review model uses each reviewer's latest opinionated review, so a later comment cannot erase an approval/change request and a later approval clears historical change requests. - Strengthen `mo-self-review` with exact affected-test selection, adaptive per-test race budgets, deterministic flake checks, and one complete owning-package race run. Zero/under-resolution JSON test durations safely use the adaptive ceiling. ## Validation - Confirmed the removed workflow runs only after a merged PR closes, is not a required check on main or 4.2-dev, and has no repository/Mergify references. - PR radar: 22 offline unit tests, Bash syntax checks, both skill validators, and live GitHub regressions: matrixorigin#25089 remains `CHANGES_REQUESTED` after a later comment; approved matrixorigin#26233 is absent from the stale-change queue. - Adaptive race measurements from `go test -json`, with `B=30s`: release-cleanup `T=0.07s, N=100`; timed-out cleanup `T=1.06s, N=28`; successful-probe cleanup `T=0.05s, N=100`. - Final focused race stress passed for all three exact tests (`-count=100/28/100`); matching non-race stress also passed. - Full `pkg/sql/plan/function` owning package passed with `-race -count=1`. - `go build` and `go vet` passed for `pkg/sql/plan/function`. - `git diff --check` passed after merging the latest main. Fixes matrixorigin#26262. Related to matrixorigin#26253.
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: fixes matrixorigin#26210 ## What this PR does / why we need it: After `task_kill_cn`, a replacement CN must rebuild table state by consuming the latest checkpoint before serving the subscription. `consumeCheckpointWithTableID` stopped its data and tombstone loops when `ObjectIter.Next()` returned an error, but discarded that error and returned nil. A context/FileService failure could therefore publish a partially reconstructed partition and finalize the table as `Subscribed`. ### Incident evidence for matrixorigin#26210 The production logs pin the reported storm to this failed-reconstruction shape rather than to ordinary TPCC contention: 1. At `17:25:22–17:25:44 UTC`, TN merge `MT-1299` compacted `bmsql_stock` and deleted its 18 source objects. The merge committed at `1785000344282453036-0`. 2. The ICKP covering `17:24:33–17:29:33 UTC` was completed at `17:31:58`, so it includes that merge deletion. A CN subscribing after this checkpoint must not serve rows from those source objects as live. 3. Replacement CN `mo-chaos-regression-dis-tp-cn-jndns` received the `bmsql_stock` subscription response at `17:32:15.660916` and logged `subscribe-ok` at `17:32:15.705894`. The triggering migrated `SELECT ... FROM bmsql_stock ... FOR UPDATE` prepare failed with `context deadline exceeded` at `17:32:15.707491`, immediately at the lazy checkpoint-consumption boundary. 4. The first reported `20618` at `17:32:55.368` is identified by TN as `TRANSFER-ERR`, `old-err=ExpectedEOB`, table `273124` (`bmsql_stock`). Its transaction ID maps back to CN `jndns`. 5. Full-window Loki counts match exactly: all **10,531** CN-side `r-w conflict` errors came from `jndns`, and TN logged exactly **10,531** `TRANSFER-ERR/ExpectedEOB` failures for table `273124`. 6. Those failures contain only 13 block-row IDs from seven objects. All seven are source objects deleted by the same `MT-1299` merge. Their TN transfer entries had already expired, which is why TN returned `ExpectedEOB`; a correctly rebuilt post-merge CN partition could not continue selecting those objects. 7. `task_kill_dn` started at `18:15:10`; the last conflict was at `18:15:13`. After logtail recovery, `jndns` subscribed `bmsql_stock` again with a new partition state at `18:16:23`, and the storm disappeared. The affected binary cannot emit the iterator error itself: `S3FS.Read` may return `ctx.Err()` before installing its event logger, `ObjectIter.Next()` returns that error, and the old loop then discards it. The observable production signature is consequently false `subscribe-ok` followed by a partition that still serves objects whose checkpointed merge deletion was not applied. The deterministic regression supplies the missing direct function-level proof: with an expired context, `ObjectIter.Next()` returns `context.DeadlineExceeded` while the affected `consumeCheckpointWithTableID` returns nil. ### Failure path 1. `ObjectIter.Next()` returns a context/FileService error from `ioutil.LoadColumnsData`. 2. The old loop exits without returning that error. 3. `Partition.ConsumeCheckpoints` receives nil, publishes the partially populated copy, and sets `checkpointConsumed=true`. 4. `loadAndConsumeLatestCkp` receives nil and advances the table to `Subscribed`. 5. The CN serves stale checkpoint objects. Updates using their row IDs reach TN after the merge transfer entries have expired, and `txnimpl/table.go` converts `TransferTable.Pin(...)=ExpectedEOB` into `20618 r-w conflict`. ### Fix This PR: - checks every data and tombstone iterator result explicitly and returns the original error; - prevents partial checkpoint state from being published or marked consumed; - prevents a failed initial load from becoming `Subscribed`, allowing retry with a fresh context; - preserves normal EOF, callback-error, and cleanup behavior; - adds real checkpoint/FileService coverage for successful consumption and data/tombstone iterator failures. There is no protocol, storage-format, RPC, locking, or normal-path I/O change. Legitimate r-w conflicts remain unchanged; this prevents the incomplete CN state that generated matrixorigin#26210’s pathological conflict storm. ## Testing - `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=5m ./pkg/vm/engine/tae/logtail` - `.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=10 -timeout=10m -run 'TestConsumeCheckpointWithTableID($|PropagatesIteratorError)' ./pkg/vm/engine/tae/logtail` - `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=10m ./pkg/vm/engine/disttae` - `go vet -mod=readonly ./pkg/vm/engine/tae/logtail` - `go build -mod=readonly ./pkg/vm/engine/tae/logtail ./pkg/vm/engine/disttae` - PR CI: UT, race-sensitive package tests, SCA, BVT, and coverage passed Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
## Summary - Remove the obsolete post-merge MOC coverage-status workflow. The current coverage pipeline is self-contained and no longer creates the legacy MOC record this workflow expects. - Stabilize three user-level-lock cleanup tests by asserting durable terminal state instead of transient asynchronous-worker ownership/progress, and always reset shared test state on early assertion exit. - Add the read-only `mo-pr-radar` skill for deterministic PR review queues, conflict/CI/approval filters, request-changes freshness, and per-PR blocker explanations. Its review model uses each reviewer's latest opinionated review, so a later comment cannot erase an approval/change request and a later approval clears historical change requests. - Strengthen `mo-self-review` with exact affected-test selection, adaptive per-test race budgets, deterministic flake checks, and one complete owning-package race run. Zero/under-resolution JSON test durations safely use the adaptive ceiling. ## Validation - Confirmed the removed workflow runs only after a merged PR closes, is not a required check on main or 4.2-dev, and has no repository/Mergify references. - PR radar: 22 offline unit tests, Bash syntax checks, both skill validators, and live GitHub regressions: matrixorigin#25089 remains `CHANGES_REQUESTED` after a later comment; approved matrixorigin#26233 is absent from the stale-change queue. - Adaptive race measurements from `go test -json`, with `B=30s`: release-cleanup `T=0.07s, N=100`; timed-out cleanup `T=1.06s, N=28`; successful-probe cleanup `T=0.05s, N=100`. - Final focused race stress passed for all three exact tests (`-count=100/28/100`); matching non-race stress also passed. - Full `pkg/sql/plan/function` owning package passed with `-race -count=1`. - `go build` and `go vet` passed for `pkg/sql/plan/function`. - `git diff --check` passed after merging the latest main. Fixes matrixorigin#26262. Related to matrixorigin#26253.
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: fixes matrixorigin#26210 ## What this PR does / why we need it: After `task_kill_cn`, a replacement CN must rebuild table state by consuming the latest checkpoint before serving the subscription. `consumeCheckpointWithTableID` stopped its data and tombstone loops when `ObjectIter.Next()` returned an error, but discarded that error and returned nil. A context/FileService failure could therefore publish a partially reconstructed partition and finalize the table as `Subscribed`. ### Incident evidence for matrixorigin#26210 The production logs pin the reported storm to this failed-reconstruction shape rather than to ordinary TPCC contention: 1. At `17:25:22–17:25:44 UTC`, TN merge `MT-1299` compacted `bmsql_stock` and deleted its 18 source objects. The merge committed at `1785000344282453036-0`. 2. The ICKP covering `17:24:33–17:29:33 UTC` was completed at `17:31:58`, so it includes that merge deletion. A CN subscribing after this checkpoint must not serve rows from those source objects as live. 3. Replacement CN `mo-chaos-regression-dis-tp-cn-jndns` received the `bmsql_stock` subscription response at `17:32:15.660916` and logged `subscribe-ok` at `17:32:15.705894`. The triggering migrated `SELECT ... FROM bmsql_stock ... FOR UPDATE` prepare failed with `context deadline exceeded` at `17:32:15.707491`, immediately at the lazy checkpoint-consumption boundary. 4. The first reported `20618` at `17:32:55.368` is identified by TN as `TRANSFER-ERR`, `old-err=ExpectedEOB`, table `273124` (`bmsql_stock`). Its transaction ID maps back to CN `jndns`. 5. Full-window Loki counts match exactly: all **10,531** CN-side `r-w conflict` errors came from `jndns`, and TN logged exactly **10,531** `TRANSFER-ERR/ExpectedEOB` failures for table `273124`. 6. Those failures contain only 13 block-row IDs from seven objects. All seven are source objects deleted by the same `MT-1299` merge. Their TN transfer entries had already expired, which is why TN returned `ExpectedEOB`; a correctly rebuilt post-merge CN partition could not continue selecting those objects. 7. `task_kill_dn` started at `18:15:10`; the last conflict was at `18:15:13`. After logtail recovery, `jndns` subscribed `bmsql_stock` again with a new partition state at `18:16:23`, and the storm disappeared. The affected binary cannot emit the iterator error itself: `S3FS.Read` may return `ctx.Err()` before installing its event logger, `ObjectIter.Next()` returns that error, and the old loop then discards it. The observable production signature is consequently false `subscribe-ok` followed by a partition that still serves objects whose checkpointed merge deletion was not applied. The deterministic regression supplies the missing direct function-level proof: with an expired context, `ObjectIter.Next()` returns `context.DeadlineExceeded` while the affected `consumeCheckpointWithTableID` returns nil. ### Failure path 1. `ObjectIter.Next()` returns a context/FileService error from `ioutil.LoadColumnsData`. 2. The old loop exits without returning that error. 3. `Partition.ConsumeCheckpoints` receives nil, publishes the partially populated copy, and sets `checkpointConsumed=true`. 4. `loadAndConsumeLatestCkp` receives nil and advances the table to `Subscribed`. 5. The CN serves stale checkpoint objects. Updates using their row IDs reach TN after the merge transfer entries have expired, and `txnimpl/table.go` converts `TransferTable.Pin(...)=ExpectedEOB` into `20618 r-w conflict`. ### Fix This PR: - checks every data and tombstone iterator result explicitly and returns the original error; - prevents partial checkpoint state from being published or marked consumed; - prevents a failed initial load from becoming `Subscribed`, allowing retry with a fresh context; - preserves normal EOF, callback-error, and cleanup behavior; - adds real checkpoint/FileService coverage for successful consumption and data/tombstone iterator failures. There is no protocol, storage-format, RPC, locking, or normal-path I/O change. Legitimate r-w conflicts remain unchanged; this prevents the incomplete CN state that generated matrixorigin#26210’s pathological conflict storm. ## Testing - `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=5m ./pkg/vm/engine/tae/logtail` - `.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=10 -timeout=10m -run 'TestConsumeCheckpointWithTableID($|PropagatesIteratorError)' ./pkg/vm/engine/tae/logtail` - `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=10m ./pkg/vm/engine/disttae` - `go vet -mod=readonly ./pkg/vm/engine/tae/logtail` - `go build -mod=readonly ./pkg/vm/engine/tae/logtail ./pkg/vm/engine/disttae` - PR CI: UT, race-sensitive package tests, SCA, BVT, and coverage passed Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
## Summary - Remove the obsolete post-merge MOC coverage-status workflow. The current coverage pipeline is self-contained and no longer creates the legacy MOC record this workflow expects. - Stabilize three user-level-lock cleanup tests by asserting durable terminal state instead of transient asynchronous-worker ownership/progress, and always reset shared test state on early assertion exit. - Add the read-only `mo-pr-radar` skill for deterministic PR review queues, conflict/CI/approval filters, request-changes freshness, and per-PR blocker explanations. Its review model uses each reviewer's latest opinionated review, so a later comment cannot erase an approval/change request and a later approval clears historical change requests. - Strengthen `mo-self-review` with exact affected-test selection, adaptive per-test race budgets, deterministic flake checks, and one complete owning-package race run. Zero/under-resolution JSON test durations safely use the adaptive ceiling. ## Validation - Confirmed the removed workflow runs only after a merged PR closes, is not a required check on main or 4.2-dev, and has no repository/Mergify references. - PR radar: 22 offline unit tests, Bash syntax checks, both skill validators, and live GitHub regressions: matrixorigin#25089 remains `CHANGES_REQUESTED` after a later comment; approved matrixorigin#26233 is absent from the stale-change queue. - Adaptive race measurements from `go test -json`, with `B=30s`: release-cleanup `T=0.07s, N=100`; timed-out cleanup `T=1.06s, N=28`; successful-probe cleanup `T=0.05s, N=100`. - Final focused race stress passed for all three exact tests (`-count=100/28/100`); matching non-race stress also passed. - Full `pkg/sql/plan/function` owning package passed with `-race -count=1`. - `go build` and `go vet` passed for `pkg/sql/plan/function`. - `git diff --check` passed after merging the latest main. Fixes matrixorigin#26262. Related to matrixorigin#26253.
What type of PR is this?
Which issue(s) this PR fixes:
fixes #26210
What this PR does / why we need it:
After
task_kill_cn, a replacement CN must rebuild table state by consuming the latest checkpoint before serving the subscription.consumeCheckpointWithTableIDstopped its data and tombstone loops whenObjectIter.Next()returned an error, but discarded that error and returned nil. A context/FileService failure could therefore publish a partially reconstructed partition and finalize the table asSubscribed.Incident evidence for #26210
The production logs pin the reported storm to this failed-reconstruction shape rather than to ordinary TPCC contention:
17:25:22–17:25:44 UTC, TN mergeMT-1299compactedbmsql_stockand deleted its 18 source objects. The merge committed at1785000344282453036-0.17:24:33–17:29:33 UTCwas completed at17:31:58, so it includes that merge deletion. A CN subscribing after this checkpoint must not serve rows from those source objects as live.mo-chaos-regression-dis-tp-cn-jndnsreceived thebmsql_stocksubscription response at17:32:15.660916and loggedsubscribe-okat17:32:15.705894. The triggering migratedSELECT ... FROM bmsql_stock ... FOR UPDATEprepare failed withcontext deadline exceededat17:32:15.707491, immediately at the lazy checkpoint-consumption boundary.20618at17:32:55.368is identified by TN asTRANSFER-ERR,old-err=ExpectedEOB, table273124(bmsql_stock). Its transaction ID maps back to CNjndns.r-w conflicterrors came fromjndns, and TN logged exactly 10,531TRANSFER-ERR/ExpectedEOBfailures for table273124.MT-1299merge. Their TN transfer entries had already expired, which is why TN returnedExpectedEOB; a correctly rebuilt post-merge CN partition could not continue selecting those objects.task_kill_dnstarted at18:15:10; the last conflict was at18:15:13. After logtail recovery,jndnssubscribedbmsql_stockagain with a new partition state at18:16:23, and the storm disappeared.The affected binary cannot emit the iterator error itself:
S3FS.Readmay returnctx.Err()before installing its event logger,ObjectIter.Next()returns that error, and the old loop then discards it. The observable production signature is consequently falsesubscribe-okfollowed by a partition that still serves objects whose checkpointed merge deletion was not applied. The deterministic regression supplies the missing direct function-level proof: with an expired context,ObjectIter.Next()returnscontext.DeadlineExceededwhile the affectedconsumeCheckpointWithTableIDreturns nil.Failure path
ObjectIter.Next()returns a context/FileService error fromioutil.LoadColumnsData.Partition.ConsumeCheckpointsreceives nil, publishes the partially populated copy, and setscheckpointConsumed=true.loadAndConsumeLatestCkpreceives nil and advances the table toSubscribed.txnimpl/table.goconvertsTransferTable.Pin(...)=ExpectedEOBinto20618 r-w conflict.Fix
This PR:
Subscribed, allowing retry with a fresh context;There is no protocol, storage-format, RPC, locking, or normal-path I/O change. Legitimate r-w conflicts remain unchanged; this prevents the incomplete CN state that generated #26210’s pathological conflict storm.
Testing
.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=5m ./pkg/vm/engine/tae/logtail.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=10 -timeout=10m -run 'TestConsumeCheckpointWithTableID($|PropagatesIteratorError)' ./pkg/vm/engine/tae/logtail.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=10m ./pkg/vm/engine/disttaego vet -mod=readonly ./pkg/vm/engine/tae/logtailgo build -mod=readonly ./pkg/vm/engine/tae/logtail ./pkg/vm/engine/disttae