release-23.1: sql: fix StatementStatistics.Nodes list #106776
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport 1/1 commits from #106587.
/cc @cockroachdb/release
EXPLAIN ANALYSE (DISTSQL)
to show regions information on secondary tenenants. It was not shown before because only system tenants have access to gossip which is used under the covers to get the node descriptors.The fix was done by adding the region name to the Flow ComponentID. This means the region name is now part of the traces for the Flow ComponentID, so it no longer needs figure out the region. It gets the region information from the same trace the SQL Instance ID is obtained. Moving the collection to the QueryLevelStats avoids iterating the traces multiple times.
Fixes: #102170, fixes: #96647, fixes: #91219;
Epic: none
Release note (bug fix): Fixes the StatementStatistics.Nodes to
contain all the nodes involved in the query. Adds region info to
EXPLAIN ANALYSE (DISTSQL)
for secondary tenants.Release Justification: Bug fix the node and region information.