Skip to content

[Subtask]: D19 [baseline] Reduce disabled-statistics scheduling and logging cost while preserving dynamic resume #32296

Open

Description

@XuPeng-SH

Parent Issue

Parent issue: #32278

Detail of Subtask

Catalog ID: D19
Origin: B - Pre-existing in the 4.2 baseline and retained on main
Evidence level: Disabled-state cost confirmed in source

4.2 versus main: provenance

Both baseline and main initialize alpha/beta/gama pools, queues, and cron setup despite DisableStatsTask. Main's executor starts with a 1s ticker and continues before resetting UpdateDuration when disabled from startup; the baseline has the same structure.

Design problem, impact, and existing responsibility

A disabled task can still initialize scheduling, check cron metadata, and log INFO every second. Disabling an already-running task retains its previous ticker interval; not every disabled state runs once per second. Pool capacity also does not mean NumCPU execution workers were eagerly created.

Acceptance criteria

  • Startup-disabled, runtime pause/resume, repeated enable/disable, and Engine.Close remain correct without unnecessary periodic SQL or high-frequency idle logs.
  • Measure disabled/idle goroutines, CPU, timers, and internal SQL; distinguish configured pool capacity from actual workers.
  • Reuse existing controls and cleanup ownership with minimal state-transition regressions rather than a new polling service.

Describe implementation you've considered

Use on-demand initialization and control-change wakeups or bounded idle waits within the existing dynamicCtx owner. Keep configuration and runtime enable/disable semantics coherent, including later enable/restart; a simple early return must not make resumption impossible.

Additional information

Existing investigation and validation limits

Main initMoTableStatsConfig:396, checkMoveOnTask:908, tableStatsExecutor:1820 and corresponding baseline paths establish the behavior. No production cost is claimed, and pool capacities are not converted into thread counts.

main investigation snapshot: pkg/vm/engine/disttae/mo_table_stats.go:396; pkg/vm/engine/disttae/mo_table_stats.go:1820

4.2 baseline snapshot: pkg/vm/engine/disttae/mo_table_stats.go:390; pkg/vm/engine/disttae/mo_table_stats.go:1765

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.

Coordination dependencies: D18 (see the parent catalog). Shared work may be consolidated into one change; a separate PR per subtask is not required.

Related existing work: #29240, #25400. Closed items identify implemented controls or historical context; they do not mean this subtask is already resolved.

Activity

  1. self-assigned this
    on Nov 5, 2026
  2. added theissue type on Nov 5, 2026
  3. changed the title [-][Subtask]: D19 [base] 降低禁用统计任务时的固定调度与日志成本,保留动态恢复[/-] [+][Subtask]: D19 [baseline] Reduce disabled-statistics scheduling and logging cost while preserving dynamic resume[/+] on Nov 5, 2026
  4. MatrixAdventurer commented on Nov 6, 2026

    @MatrixAdventurer
    Contributor

    分级建议:severity/s-1——禁用统计任务后仍有初始化/调度与日志开销(正文已按源码确认),属性能负担型债务,无功能错误。
    所属模块:统计任务调度(DisableStatsTask 下的初始化与 1s ticker)。
    疑似重复:未发现。
    建议负责人:XuPeng-SH(父单 #32278 发起人、本子任务 assignee)。
    本操作由LW授权的MOI智能体提交

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions