cockroachdb / cockroachdb/cockroach

sql stats: add kv node info to statement_statistics and transactions_statistics

Open
#106,165 0 comments 0 reactions 0 assignees View on GitHub
A-cluster-observability C-enhancement T-observability
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

The `statement_statistics` and `transactions_statistics` log the SQL instances the query is executed on but not the KV nodes. In CRDB a gateway node has 2 ways to get information from other nodes.
1. Gateway node sends a request to a remote SQL instance. Then that remote SQL instance ideally calls the local KV node. The remote SQL instance then applies some logic to the data, and then returns the data to the original gateway node.
2. Gateway node can directly calls remote KV nodes. The remote KV node returns data directly to the original gateway node.

This is decided based on the SQL query and the optimizer. Usually going directly to the KV node is done for single row reads. Need to discuss more with SQL queries team to fully understand.

The problem with the current logic is that it only tracks calls to remote SQL instances. This can make users believe that the query was executed just on one node, but it could have directly called a remote KV node that could be in another region.

Jira issue: CRDB-29434

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.