You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
execstats: add latch wait time into cumulative contention time
This patch adds a field `IsLatch` to the `ContentionEvent` protobuf struct that
indicates that a contention event was emitted by the latch table. The event is
added to the trace and used to increment the contention time metrics, but is
only added to the contention registry if
`register_latch_wait_contention_events` is set to true.
This commit also propagates the transaction ID into the latch manager and the
contention events listener. This information is used during a latch wait event
to distinguish between time waiting for a transaction's own requests
(e.g. for QueryIntent) and for real contention between different transactions.
Fixes#103713
Release note (ui change): The contention time metric now includes time spent
waiting to acquire latches in addition to time spent acquiring locks. This
applies to both the cumulative contention time visible in the db console and
the annotations of an `EXPLAIN ANALYZE` output.
[8] sequence req6: waiting to acquire read latch ‹{a-e}›@12.000000000,1 for request Scan [‹"a"›,‹"e"›), [txn: 00000002], held by write latch ‹d›@10.000000000,1 for request Put [‹"d"›], [txn: 00000003]
176
176
[8] sequence req6: blocked on select in spanlatch.(*Manager).waitForSignal
177
177
178
+
debug-advance-clock ts=123
179
+
----
180
+
178
181
# req4 finishing releases the latch and allows req6 to proceed.
179
182
finish req=req4
180
183
----
181
184
[-] finish req4: finishing request
185
+
[8] sequence req6: latch conflict with 00000003-0000-0000-0000-000000000000 on ‹"d"› for 123.000s
182
186
[8] sequence req6: scanning lock table for conflicting locks
183
187
[8] sequence req6: sequencing complete, returned guard
0 commit comments