Repository navigation
Description
Parent Issue
Parent issue: #32278
Detail of Subtask
Catalog ID: D08
Origin: B - Pre-existing in the 4.2 baseline and retained on main
Evidence level: Additional network work confirmed by a probe
4.2 versus main: provenance
Most refreshableTaskStorage methods on both 4.2 and main Ping before executing SQL. Main already has a sensible ValidateDaemonTask path without that preflight, but most other methods have not been consolidated.
Design problem, impact, and existing responsibility
Ping cannot guarantee the following SQL succeeds, yet consumes connection/network work. The underlying driver sends COM_PING and waits for OK; an actual operation error already triggers the same maybeRefresh path. This affects queries, heartbeats, and multiple task-metadata operations.
Acceptance criteria
- Representative normal operations no longer issue an additional COM_PING each time; initial discovery, connection failure, and address changes still recover.
- Cover cancellation, missing storage, shutdown, operation failure, and refresh races. Preserve correct errors for closed storage and real write failures.
- Report request-count reduction and representative latency; do not interpret probe counts as proof that every SQL operation takes exactly twice as long.
Describe implementation you've considered
Use database/sql, driver, and real operation errors as feedback while preserving address discovery, error-triggered refresh, and any necessary independent health checks. Check read/write/transaction/disabled/closed behavior by operation class. Avoid introducing a second health state machine.
Additional information
Existing investigation and validation limits
The real forwarding path invokes QuerySQLTask 1,000 times; the counting dependency observes 1,000 queries plus 1,000 Pings. Driver v1.9.3 performs network I/O for Ping. ValidateDaemonTask already documents that an actual read error can trigger the same asynchronous refresh. This is a dependency-count probe, not a real-network latency benchmark.
main investigation snapshot: pkg/taskservice/task_service_holder.go:236; pkg/taskservice/task_service_holder.go:635
4.2 baseline snapshot: pkg/taskservice/task_service_holder.go:236
The named probes are local diagnostic overlays, not committed repository tests. Their names identify the investigation; they cannot be selected directly from an ordinary checkout. Implement the smallest maintained contract regressions and reuse relevant CI/validation proportionally. Temporary evidence commits are not required.
Related existing work: #24144. Closed items identify implemented controls or historical context; they do not mean this subtask is already resolved.
Activity
[-][Subtask]: D08 [base] 以真实存储操作反馈驱动刷新,收敛 task storage 逐操作 Ping[/-][+][Subtask]: D08 [baseline] Use actual storage results for refresh instead of a Ping before each operation[/+]