schema_version: 1
id: tikv-read-iops-full-ranking-across-two-clusters-during-incident-window
title: Cluster-scoped TiKV full ranking by max 1-minute read IOPS across two clusters in the latest completed Beijing 11:00-11:05 window
status: active
owner: codex
evaluation:
  mode: adhoc_evidence
environment:
  profile: stable-dedicated
  cluster_id_a: '10518506906906971664'
  cluster_id_b: '10989049060142230334'
  cluster_type: dedicated
  tidb_version: v8.5.x
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-a
      - '{{environment.cluster_id_a}}'
      - --cluster-id-b
      - '{{environment.cluster_id_b}}'
      - --local-hour
      - '11'
      - --local-minute
      - '0'
      - --duration-minutes
      - '5'
      - --step-seconds
      - '60'
  - id: build_runtime_reference
    stage: before_judge
    kind: python_script
    path: runtime_hook.py
    output_id: reference_answer
    args:
      - build-reference
      - --cluster-id-a
      - '{{environment.cluster_id_a}}'
      - --cluster-id-b
      - '{{environment.cluster_id_b}}'
      - --start
      - '{{runtime.resolved_window.start}}'
      - --end
      - '{{runtime.resolved_window.end}}'
      - --step-seconds
      - '60'
prompt:
  text: |
    帮我把这两个集群 {{environment.cluster_id_a}} 和 {{environment.cluster_id_b}} 在 {{runtime.resolved_window.start}} 到 {{runtime.resolved_window.end}} 这 5 分钟里的所有 TiKV 节点读盘峰值排一下。

    我只关心最后结果：
    1. 先按 `cluster_id` 字典序排 cluster；
    2. 每个 cluster 内，把所有 TiKV 节点按这 5 分钟窗口里的 `max 1m read IOPS` 从高到低排完，不要只给 top 3；
    3. 如果同一个 cluster 内 `max_1m_read_iops` 一样，就按 `tikv_node` 字典序排；
    4. 最终只输出一个 `json` 代码块，字段必须严格为：
       `window`、`mapping_strategy`、`evidence_sufficient`、`nodes_by_cluster`
    5. `nodes_by_cluster` 里的每个元素必须严格包含：
       `cluster_id`、`nodes`
    6. `nodes` 必须是数组，里面每个元素都必须严格是：
       `["<tikv_node>", <max_1m_read_iops>]`
    7. 不要输出额外字段，不要输出额外解释，不要把说明写进 JSON。

    JSON 结构如下：

    ```json
    {
      "window": {
        "start": "2026-01-01T03:00:00Z",
        "end": "2026-01-01T03:05:00Z"
      },
      "mapping_strategy": "node_filter",
      "evidence_sufficient": true,
      "nodes_by_cluster": [
        {
          "cluster_id": "10518506906906971664",
          "nodes": [
            ["db-tikv-0", 12345.67],
            ["db-tikv-1", 12222.22]
          ]
        },
        {
          "cluster_id": "10989049060142230334",
          "nodes": [
            ["db-tikv-0", 23456.78],
            ["db-tikv-1", 21000.01]
          ]
        }
      ]
    }
    ```

    如果证据不足，请把 `evidence_sufficient` 设为 `false`，并把 `nodes_by_cluster` 设为空数组。
tags:
- storage-performance
- metric-scope
- read-iops
- multi-cluster
- structured-output
case_tier: P1
cost_tier: medium
followup:
  scheduled_max_followups: 0
execution:
  acp_bash_timeout_s: 420
