Repository navigation
worker(dm): isolate source errors in query status snapshots - #12883
Conversation
Deep-copy the saved source status while holding the server lock so repeated and concurrent queries cannot append errors to the shared result. Cover nil and existing saved errors, stable response size, and unchanged earlier snapshots.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to Repeated status queries now avoid accumulating source errors while preserving saved status; no actionable merge risk remains. Security Architecture Review
Pre-merge checks |
|
Keep the source status getter unchanged. Clone the saved ProcessResult only when QueryStatus is about to append the current upstream error, following the existing result-copying pattern in getAllSubTaskStatus.
|
/retest |
|
/retest |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: D3Hunter, joechenrh The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…5361) ### What is changed Revert #4909: remove the `GOPROXY=direct` prefix from the `error-log-review` presubmit jobs, so the go command resolves the tool and its dependencies through the default Go module proxy again. Files (5): - `prow-jobs/pingcap/ticdc/latest-presubmits.yaml` - `prow-jobs/pingcap/tiflash/latest-presubmits.yaml` - `prow-jobs/pingcap/tiflow/latest-presubmits.yaml` - `prow-jobs/tikv/pd/latest-presubmits.yaml` - `prow-jobs/tikv/tikv/latest-presubmits.yaml` ### Why `GOPROXY=direct` makes the go command resolve every dependency from its origin host instead of a module proxy. On 2026-10-13 (~02:00–02:35 UTC) `gopkg.in` returned a transient `502 Proxy Error`, which broke all of these presubmits with: ``` config.go:9:2: unrecognized import path "gopkg.in/yaml.v3": reading https://gopkg.in/yaml.v3?go-get=1: 502 Proxy Error ``` Example failed run: https://prow.tidb.net/view/gs/prow-tidb-logs/pr-logs/pull/pingcap_tiflow/12883/pull-error-log-review/2109830078522200064 Failing runs in that window: pingcap/tiflow#12883, pingcap/ticdc#6466, tikv/pd#11337, tikv/pd#11338, tikv/pd#11349; a later run at 02:36 UTC passed. The error-log-review presubmits are non-optional, so this blocked Tide merge. #4909 added `GOPROXY=direct` so that `go run ...@main` always resolves the latest commit immediately, bypassing module-proxy branch-query caching. Reverting trades that freshness for reliability: right after a push to main, `@main` may briefly resolve to a stale pseudo-version, which is acceptable for this presubmit. ### Validation - `git revert 99b33ce` applies cleanly (auto-merge, no conflicts). - `prow-jobs/kustomization.yaml` uses `disableNameSuffixHash: true`, so no hash regeneration is needed.
|
/retest |
|
In response to a cherrypick label: new pull request created to branch |
|
In response to a cherrypick label: new pull request created to branch |
What problem does this PR solve?
Issue Number: close #12882
When a worker already has a saved source error and the upstream connection remains
unavailable, each
QueryStatuscall appends another error to the saved result.Repeated polling can grow the response beyond the gRPC receive limit, making even
queries for a nonexistent task fail.
What is changed and how it works?
getSourceStatusunchanged. InQueryStatus, clone an existingProcessResultonly when appending the current upstream error. This followsthe result-copying pattern already used by
getAllSubTaskStatusand avoidschanging the saved result or an earlier response.
repeated and concurrent queries, checks stable response content/size, and
verifies that the saved status and earlier response remain unchanged.
unchanged. This PR fixes the source-error accumulation; it does not change the
OpenAPI handling of unrelated worker RPC failures.
Check List
Tests
make dm_unit_test_pkg PKG=github.com/pingcap/tiflow/dm/worker(full package, race detector and failpoints enabled)go test -race ./dm/worker -run '^TestQueryStatusDoesNotAccumulateSourceErrors$' -count=10contains three errors instead of the expected two.
go vet ./dm/workermake fmtgit diff --checkQuestions
Will it cause performance regression or break compatibility?
No wire-format or configuration compatibility change. Only queries that append
an upstream error to an existing result copy that small result. The normal path
and the nil-result path remain unchanged, while error-list growth and shared
mutation are avoided.
Do you need to update user documentation, design documentation or monitoring documentation?
No.
Release note
Summary by CodeRabbit