Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui: SQL activity statement overview shows incorrect region/nodes #91219

Closed
j82w opened this issue Nov 3, 2022 · 0 comments · Fixed by #106587
Closed

ui: SQL activity statement overview shows incorrect region/nodes #91219

j82w opened this issue Nov 3, 2022 · 0 comments · Fixed by #106587
Assignees
Labels
A-sql-observability Related to observability of the SQL layer C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

Comments

@j82w
Copy link
Contributor

j82w commented Nov 3, 2022

Connection to the cluster is using gcp-us-east1. While the database primary region is gcp-us-east4.

Database r has primary region.

ALTER DATABASE r SET PRIMARY REGION "gcp-us-east4";

Results from show ranges from table testing;:
nodes:
"{2,3,5}",

replica_localities:
"{region=gcp-us-east4,az=gcp-us-east4-a,dns=cockroachdb-0.cockroachdb.us-east4.svc.cluster.local,region=gcp-us-east4,az=gcp-us-east4-b,dns=cockroachdb-1.cockroachdb.us-east4.svc.cluster.local,region=gcp-us-east4,az=gcp-us-east4-c,dns=cockroachdb-2.cockroachdb.us-east4.svc.cluster.local}"

cockroach node status

  id |                          address                           |                        sql_address                         |             build             |         started_at         |         updated_at         |                                            locality                                            | is_available | is_live
-----+------------------------------------------------------------+------------------------------------------------------------+-------------------------------+----------------------------+----------------------------+------------------------------------------------------------------------------------------------+--------------+----------
   1 | cockroachdb-0.cockroachdb.us-east1.svc.cluster.local:26257 | cockroachdb-0.cockroachdb.us-east1.svc.cluster.local:26257 | v22.2.0-beta.5-47-gc4b5954aa9 | 2022-11-01 14:21:19.669199 | 2022-11-03 17:58:00.255253 | region=gcp-us-east1,az=gcp-us-east1-b,dns=cockroachdb-0.cockroachdb.us-east1.svc.cluster.local | true         | true
   2 | cockroachdb-0.cockroachdb.us-east4.svc.cluster.local:26257 | cockroachdb-0.cockroachdb.us-east4.svc.cluster.local:26257 | v22.2.0-beta.5-47-gc4b5954aa9 | 2022-11-01 14:34:04.745978 | 2022-11-03 17:58:00.330176 | region=gcp-us-east4,az=gcp-us-east4-a,dns=cockroachdb-0.cockroachdb.us-east4.svc.cluster.local | true         | true
   3 | cockroachdb-1.cockroachdb.us-east4.svc.cluster.local:26257 | cockroachdb-1.cockroachdb.us-east4.svc.cluster.local:26257 | v22.2.0-beta.5-47-gc4b5954aa9 | 2022-11-01 14:29:42.408186 | 2022-11-03 17:57:58.995637 | region=gcp-us-east4,az=gcp-us-east4-b,dns=cockroachdb-1.cockroachdb.us-east4.svc.cluster.local | true         | true
   4 | cockroachdb-1.cockroachdb.us-east1.svc.cluster.local:26257 | cockroachdb-1.cockroachdb.us-east1.svc.cluster.local:26257 | v22.2.0-beta.5-47-gc4b5954aa9 | 2022-11-01 14:16:53.077302 | 2022-11-03 17:57:59.209878 | region=gcp-us-east1,az=gcp-us-east1-c,dns=cockroachdb-1.cockroachdb.us-east1.svc.cluster.local | true         | true
   5 | cockroachdb-2.cockroachdb.us-east4.svc.cluster.local:26257 | cockroachdb-2.cockroachdb.us-east4.svc.cluster.local:26257 | v22.2.0-beta.5-47-gc4b5954aa9 | 2022-11-01 14:25:22.4965   | 2022-11-03 17:58:00.079107 | region=gcp-us-east4,az=gcp-us-east4-c,dns=cockroachdb-2.cockroachdb.us-east4.svc.cluster.local | true         | true
   6 | cockroachdb-2.cockroachdb.us-east1.svc.cluster.local:26257 | cockroachdb-2.cockroachdb.us-east1.svc.cluster.local:26257 | v22.2.0-beta.5-47-gc4b5954aa9 | 2022-11-01 14:12:35.111225 | 2022-11-03 17:58:02.189002 | region=gcp-us-east1,az=gcp-us-east1-d,dns=cockroachdb-2.cockroachdb.us-east1.svc.cluster.local | true         | true
   7 | cockroachdb-0.cockroachdb.us-west2.svc.cluster.local:26257 | cockroachdb-0.cockroachdb.us-west2.svc.cluster.local:26257 | v22.2.0-beta.5-47-gc4b5954aa9 | 2022-11-01 14:47:07.854271 | 2022-11-03 17:58:00.461577 | region=gcp-us-west2,az=gcp-us-west2-a,dns=cockroachdb-0.cockroachdb.us-west2.svc.cluster.local | true         | true
   8 | cockroachdb-1.cockroachdb.us-west2.svc.cluster.local:26257 | cockroachdb-1.cockroachdb.us-west2.svc.cluster.local:26257 | v22.2.0-beta.5-47-gc4b5954aa9 | 2022-11-01 14:42:46.160272 | 2022-11-03 17:57:59.751161 | region=gcp-us-west2,az=gcp-us-west2-b,dns=cockroachdb-1.cockroachdb.us-west2.svc.cluster.local | true         | true
   9 | cockroachdb-2.cockroachdb.us-west2.svc.cluster.local:26257 | cockroachdb-2.cockroachdb.us-west2.svc.cluster.local:26257 | v22.2.0-beta.5-47-gc4b5954aa9 | 2022-11-01 14:38:24.61035  | 2022-11-03 17:57:59.211808 | region=gcp-us-west2,az=gcp-us-west2-c,dns=cockroachdb-2.cockroachdb.us-west2.svc.cluster.local | true         | true
(9 rows)

The results from select * from crdb_internal.statement_statistics shows n1 which in gcp-us-east1. Both the statistics column nodes list id 1 which is in gcp-us-east1 which is likely the gateway node. The sampled_plan also list gcp-us-east1. It does not list gcp-us-east4 where the database is located.

{
  "metadata":{
    "db": "r",
    "distsql": true,
    "failed": false,
    "fullScan": true,
    "implicitTxn": true,
    "query": "SELECT * FROM testing",
    "querySummary": "SELECT * FROM testing",
    "stmtTyp": "TypeDML",
    "vec": true
  },
  "statistics":{
    "execution_statistics": {
      "cnt": 2,
      "contentionTime": { "mean": 0, "sqDiff": 0 },
      "maxDiskUsage": { "mean": 0, "sqDiff": 0 },
      "maxMemUsage": { "mean": 2.56e4, "sqDiff": 5.24288e7 },
      "networkBytes": { "mean": 128, "sqDiff": 32768 },
      "networkMsgs": { "mean": 1.5, "sqDiff": 4.5 }
    },
    "index_recommendations": [],
    "statistics": {
      "bytesRead": { "mean": 1.2e2, "sqDiff": 0 },
      "cnt": 5,
      "firstAttemptCnt": 5,
      "lastExecAt": "2022-11-03T17:10:23.041547968Z",
      "maxRetries": 0,
      "nodes": [1],
      "numRows": { "mean": 4, "sqDiff": 0 },
      "ovhLat": {
        "mean": 0.0000039523999999999115,
        "sqDiff": 6.875601200002095e-12
      },
      "parseLat": { "mean": 0, "sqDiff": 0 },
      "planGists": ["AgH+AQIAAwAAAAYE"],
      "planLat": {
        "mean": 0.00009546299999999999,
        "sqDiff": 5.1936769240000016e-9
      },
      "rowsRead": { "mean": 4, "sqDiff": 0 },
      "rowsWritten": { "mean": 0, "sqDiff": 0 },
      "runLat": { "mean": 0.0117398544, "sqDiff": 0.0001531466078649692 },
      "svcLat": { "mean": 0.0118392698, "sqDiff": 0.0001514320110579268 }
    }
  },
  "sampled_plan":{
    "Actual Row Count": "4",
    "Children": [],
    "Estimated Max Memory Allocated": "20 KiB",
    "KV Bytes Read": "120 B",
    "KV Contention Time": "0µs",
    "KV GRPC Calls": "1",
    "KV Rows Read": "4",
    "KV Time": "452µs",
    "Missing Stats": "",
    "Name": "scan",
    "Nodes": "n1",
    "Regions": "gcp-us-east1",
    "Spans": "FULL SCAN",
    "Table": "testing@testing_pkey"
  }
}

The ui matches the above info in crdb_internal.statement_statistics.

Screen Shot 2022-11-03 at 1 13 58 PM

The problem is the database r is only in gcp-us-east4, but the results are saying gcp-us-east1 (n1).

Jira issue: CRDB-21159

@j82w j82w added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. A-sql-observability Related to observability of the SQL layer T-sql-observability labels Nov 3, 2022
@j82w j82w self-assigned this May 25, 2023
@craig craig bot closed this as completed in 269b9e3 Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-observability Related to observability of the SQL layer C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant