sqlstats: fix reset stats container on flush #121134
Labels
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
T-observability
cockroach/pkg/sql/sqlstats/ssmemstorage/ss_mem_storage.go
Lines 607 to 613 in a44e43c
In the above,
freeLocked
is called after clearing the containers. WithinfreeLocked
, the size of each container cleared is used to decrement uniqueServerCount which is used to track the total number of in-memory fingerprints tracked by sql stats. Due to these steps we never actually decrement the counter after each flush, causing the uniqueServerCount to grow erroneously. This can cause us to incorrectly spam sending the memory pressure signal to the sql stats flush worker, causing rapid flushing of empty containers.Jira issue: CRDB-37092
The text was updated successfully, but these errors were encountered: