schema_version: 1
id: map-selected-tikv-pods-to-worker-nodes-in-saas01
title: Map selected TiKV pods to worker nodes in saas01 from a recent live snapshot
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
time_window:
  resolved_by_output: case_input
runtime:
  hooks:
  - id: prepare_case_input
    stage: before_acp
    kind: python_script
    path: runtime_hook.py
    output_id: case_input
    args:
      - prepare-case-input
      - --cluster-id
      - '{{environment.cluster_id}}'
      - --cluster-label
      - '{{environment.cluster_label}}'
      - --snapshot-lag-seconds
      - '600'
      - --window-seconds
      - '300'
      - --pod-count
      - '4'
  - 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}}'
      - --snapshot-time
      - '{{runtime.case_input.snapshot_time}}'
      - --window-seconds
      - '300'
      - --pods-csv
      - '{{runtime.case_input.pods_csv}}'
prompt:
  text: |
    帮我看一下 {{environment.cluster_label}} 这个集群（{{environment.cluster_id}}）在
    `{{runtime.case_input.snapshot_time}}` 这个时间点，下面这些 TiKV pod 分别跑在哪台 worker node 上：

    {{runtime.case_input.pods_json}}

    我只看最后结果，最终只输出一个 `json` 代码块，字段必须严格为：
    `cluster_id`、`snapshot_time`、`evidence_sufficient`、`pod_mappings`

    `pod_mappings` 必须严格按我给你的 pod 顺序返回。每个元素都只能包含：
    `tikv_pod`、`worker_node`

    不要输出额外字段，不要输出额外解释，也不要把说明写进 JSON。

    JSON 结构如下：

    ```json
    {
      "cluster_id": "10989049060142230334",
      "snapshot_time": "2026-01-01T03:05:00Z",
      "evidence_sufficient": true,
      "pod_mappings": [
        {
          "tikv_pod": "db-tikv-0",
          "worker_node": "ip-10-0-0-10.us-west-2.compute.internal"
        },
        {
          "tikv_pod": "db-tikv-7",
          "worker_node": "ip-10-0-0-11.us-west-2.compute.internal"
        }
      ]
    }
    ```

    如果证据不足，请把 `evidence_sufficient` 设为 `false`，并把 `pod_mappings`
    设为空数组。
tags:
- topology
- pod-mapping
- kube-pod-info
- structured-output
- adhoc-evidence
- saas01
case_tier: P1
cost_tier: low
followup:
  scheduled_max_followups: 0
execution:
  acp_bash_timeout_s: 300
