schema_version: 1
id: compaction-signals-on-db-tikv-9-in-saas01-during-latest-window
title: Single-node compaction signals on db-tikv-9 in saas01 during the latest completed Beijing 11:00-11:05 window
status: active
owner: codex
evaluation:
  mode: adhoc_evidence
environment:
  profile: stable-dedicated
  cluster_label: saas01
  cluster_id: '10989049060142230334'
  cluster_type: dedicated
  tidb_version: v8.5.x
  target_tikv_node: db-tikv-9
time_window:
  resolved_by_output: resolved_window
runtime:
  hooks:
  - id: resolve_runtime_window
    stage: before_acp
    kind: python_script
    path: runtime_hook.py
    output_id: resolved_window
    args:
      - resolve-window
      - --cluster-id
      - '{{environment.cluster_id}}'
      - --cluster-label
      - '{{environment.cluster_label}}'
      - --target-tikv-node
      - '{{environment.target_tikv_node}}'
      - --local-hour
      - '11'
      - --local-minute
      - '0'
      - --duration-minutes
      - '5'
      - --step-seconds
      - '300'
  - id: build_runtime_reference
    stage: before_judge
    kind: python_script
    path: runtime_hook.py
    output_id: reference_answer
    args:
      - build-reference
      - --cluster-id
      - '{{environment.cluster_id}}'
      - --cluster-label
      - '{{environment.cluster_label}}'
      - --target-tikv-node
      - '{{environment.target_tikv_node}}'
      - --start
      - '{{runtime.resolved_window.start}}'
      - --end
      - '{{runtime.resolved_window.end}}'
prompt:
  text: |
    帮我看下 {{environment.cluster_label}} 这个集群（{{environment.cluster_id}}）
    在 {{runtime.resolved_window.start}} 到 {{runtime.resolved_window.end}} 这 5 分钟里，
    `{{environment.target_tikv_node}}` 这个节点有没有比较明显的 compaction 堆积或者 L0 压力。

    不用展开过程，最后直接给我一个 `json` 代码块就行，字段固定为：
    `cluster_id`、`tikv_node`、`window`、`evidence_sufficient`、`signals`

    `signals` 里固定放这几个字段：
    `write_cf_pending_compaction_bytes_max`
    `lock_cf_pending_compaction_bytes_max`
    `write_cf_l0_files_max`
    `lock_cf_l0_files_max`

    不要输出额外解释，也不要多输出别的字段。

    JSON 结构如下：

    ```json
    {
      "cluster_id": "10989049060142230334",
      "tikv_node": "db-tikv-9",
      "window": {
        "start": "2026-01-01T03:00:00Z",
        "end": "2026-01-01T03:05:00Z"
      },
      "evidence_sufficient": true,
      "signals": {
        "write_cf_pending_compaction_bytes_max": 123456789,
        "lock_cf_pending_compaction_bytes_max": 9876543,
        "write_cf_l0_files_max": 18,
        "lock_cf_l0_files_max": 4
      }
    }
    ```

    如果证据不足，请把 `evidence_sufficient` 设为 `false`，并把 `signals` 里的 4 个字段都设为 `null`。
tags:
- tikv
- compaction
- l0-pressure
- single-node-scope
- structured-output
- adhoc-evidence
- saas01
case_tier: P1
cost_tier: low
followup:
  scheduled_max_followups: 0
execution:
  acp_bash_timeout_s: 300
