Skip to content

[Subtask]: D11 [baseline] Define SQL task history retention and bounded default history reads #32289

Open

Description

@XuPeng-SH

Parent Issue

Parent issue: #32278

Detail of Subtask

Catalog ID: D11
Origin: B - Pre-existing in the 4.2 baseline and retained on main
Evidence level: Capacity and operational design gap confirmed in source

4.2 versus main: provenance

Both 4.2 and main append sql_task_run records per attempt. DROP TASK removes definitions/child async tasks but keeps history. SHOW TASK RUNS limits results only when the user explicitly specifies LIMIT.

Design problem, impact, and existing responsibility

Task-generated history grows independently of ordinary completed-async cleanup. Storage scans all matching rows into a Go slice before frontend result materialization. Apart from account removal, no time/count retention implementation was found, and TaskStorage has no history-trimming operation. History has value; capacity and read contracts are missing.

Acceptance criteria

  • Specify retention defaults/configuration and compatibility implications without silently discarding history required by the supported contract.
  • Default SHOW does not materialize all historical rows; preserve explicit LIMIT, task/account filters, ordering, and post-deletion history behavior.
  • Cleanup is cancellable and incremental without excessive task-write interference. Keep boundary regressions small and scale measurements in a separate performance scenario.

Describe implementation you've considered

Define time/count retention, history after DROP, administrator controls, and bounded default display within existing storage/maintenance ownership. Provide explicit full/paged access according to the product contract rather than adding another history database or permanent service.

Additional information

Existing investigation and validation limits

The investigation covered query/scan, DeleteSQLTask, ordinary async GC, account cleanup, and non-test references. No OOM reproduction is claimed, and APIs returning large results are not automatically classified as bugs.

main investigation snapshot: pkg/frontend/sql_task_handler.go:269; pkg/taskservice/mysql_task_storage.go:856; pkg/taskservice/mysql_task_storage.go:1117

4.2 baseline snapshot: pkg/frontend/sql_task_handler.go; pkg/taskservice/mysql_task_storage.go

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.

Activity

  1. self-assigned this
    on Nov 5, 2026
  2. added theissue type on Nov 5, 2026
  3. changed the title [-][Subtask]: D11 [base] 补齐 SQL task 运行历史的保留合同与默认有界展示[/-] [+][Subtask]: D11 [baseline] Define SQL task history retention and bounded default history reads[/+] on Nov 5, 2026
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