{
  "repo": "tidbcloud/tidb-cse",
  "binary": "tidb-server",
  "binary_path": "cmd/tidb-server/main.go",
  "dependencies": {
    "Runtime TiDBCSEServer.serveSQLAndStatus": {
      "infrastructure": {
        "tcp": {
          "conditions": [
            "Always after TiDB CSE bootstrap succeeds"
          ],
          "operations": [
            {
              "operation": "SERVE MYSQL PROTOCOL",
              "trigger": "Start the main TiDB CSE SQL listener",
              "conditions": [
                "cmd/tidb-server completes configuration and store/domain initialization"
              ],
              "implementation": "server.NewServer(cfg, driver) and downstream server bootstrap in cmd/tidb-server/main.go"
            }
          ]
        },
        "http": {
          "conditions": [
            "When report-status is enabled"
          ],
          "operations": [
            {
              "operation": "SERVE STATUS HTTP",
              "trigger": "Expose metrics, status, debug, and related HTTP endpoints on the status port",
              "conditions": [
                "The status listener is configured and started"
              ],
              "implementation": "pkg/server/http_status.go"
            }
          ]
        }
      },
      "services": [
        {
          "name": "tikv",
          "protocol": "grpc",
          "target_interface": "client-go PD/TiKV traffic from the SQL server",
          "purpose": "Back the TiDB CSE SQL service with transactional and metadata operations"
        }
      ]
    },
    "Runtime TiDBCSEServer.serveRPCStatus": {
      "infrastructure": {
        "grpc": {
          "conditions": [
            "When the status listener is active"
          ],
          "operations": [
            {
              "operation": "SERVE STATUS GRPC",
              "trigger": "Multiplex the TiDB CSE status listener into HTTP and gRPC traffic",
              "conditions": [
                "The status port is open"
              ],
              "implementation": "pkg/server/http_status.go and pkg/server/rpc_server.go"
            }
          ]
        }
      },
      "services": []
    }
  }
}
