Skip to content

[Tech request]: Resource statistics when compile retry execute #18449

Description

@qingxinhome

Is there an existing issue for the same feature request?

  • I have checked the existing issues.

Is your feature request related to a problem?

由于compile物理计划失败重试时,不同CU资源维度,统计策略并不一样, 主要涉及如下三个方面:

1. 对于物理计划的Pipeline执行, 其资源消耗(内存Mem, CPU时间, 网络IO等),会将每次重试执行的资源消耗累加到原始的Plan Node中, 但是如果重试执行时,逻辑计划重新BuildPlan,那么之前执行失败的Pipeline资源消耗会被丢弃

2. 对于S3 空间资源的统计,在每次重试执行时,会用 `NewCompile` 方法重新创建一个 `Compile` 对象,重新实例化`counterSet`作为观察者, 因此,S3空间资源的统计总是来自于最后一次物理计划的重试执行

3. 对于S3 和磁盘IO等待时间 ,在前端接收到请求后在Context中埋入StatsInfo, 物理计划执行期间,由`FileService`磁盘IO, 网络IO,缓存IO和 锁等待的时间统计,该部分时间资源的统计贯穿整个sql执行阶段,包括了多次失败重试

基于以上现状,在发生compile发生重试时,资源统计策略并不一致,而且系统没有重试次数的限制,这样可能会导致,CU的时间统计结果为负

Describe the feature you'd like

  1. 当sql执行compile出现重试执行, 对每次重试执行的物理资源单独统计,不遗漏
  2. 当发生重试执行时, 要做执行的资源统计模块重置, 每次执行的资源互补干涉

Describe implementation you've considered

No response

Documentation, Adoption, Use Case, Migration Strategy

No response

Additional information

No response

Activity

  1. self-assigned this
    on Aug 31, 2024
  2. added this to the 1.3.0 milestone on Sep 19, 2024
  3. modified the milestones: 2.0.0, 2.0.1 on Oct 15, 2024
  4. ghost changed the title [-][Feature Request]: Resource statistics when compile retry execute[/-] [+][Tech request]: Resource statistics when compile retry execute[/+] on Nov 11, 2024
  5. daviszhen commented on Nov 12, 2024

    @daviszhen
    Contributor

    2.0.1 来不及

  6. modified the milestones: 2.0.1, 2.1.0 on Nov 12, 2024
  7. added
    priority/p0
    on Dec 14, 2024
  8. added theissue type on Apr 25, 2025
  9. modified the milestones: 2.1.0, 2509 on Apr 25, 2025
  10. modified the milestones: MO-2509, MO-202603 on Feb 3, 2026
  11. assigned and unassigned on Jun 29, 2026
  12. added
    severity/s0
    on Jul 17, 2026
  13. added a commit that references this issue on Jul 23, 2026
    b8a190a
  14. aptend commented on Jul 28, 2026

    @aptend
    Contributor

    fixed

  15. added 3 commits that reference this issue on Sep 17, 2026
    e5ac4f9
    68fbe7f
    b4aac8a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/featurepriority/p0severity/s0

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions