Skip to content

sql: statement contention metric is calculating the txn contention instead of stmt #96429

@j82w

Description

@j82w

There is a bug in this recent refactoring of the contention information which causes the statement increment to be done at the txn level instead. The following line needs to be moved to the statement finish so the metric is at the stmt level instead of the transaction level.

ex.planner.DistSQLPlanner().distSQLSrv.Metrics.ContendedQueriesCount.Inc(1)

https://cockroachlabs.slack.com/archives/C0159JK877C/p1675297127031379

Jira issue: CRDB-24120

Metadata

Metadata

Assignees

Labels

A-sql-observabilityRelated to observability of the SQL layerC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions