Skip to content

sqlstats: fix counter for in-memory fingerprints#111613

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
j82w:111583
Oct 3, 2023
Merged

sqlstats: fix counter for in-memory fingerprints#111613
craig[bot] merged 1 commit intocockroachdb:masterfrom
j82w:111583

Conversation

@j82w
Copy link
Copy Markdown
Contributor

@j82w j82w commented Oct 2, 2023

Problem:
The counters used to track the number of unique fingerprints we store in-memory for sql stats were refactored in #110805. In change #110805 a bug was introduced where it incresease the memory instead of resetting the counts. This causes the statstics to stop calculating new stats once the limit is hit.

Solution:
Fix the bug by resetting the counters instead of increasing them. Added new test to test the reset functionality.

Fixes: #111583

Release note (sql change): Fix a bug that causes the sql stats to stop collecting new stats.

@j82w j82w requested a review from a team October 2, 2023 20:42
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@j82w j82w added the backport-23.1.x PAST MAINTENANCE SUPPORT: 23.1 patch releases via ER request only label Oct 2, 2023
Copy link
Copy Markdown
Contributor

@maryliag maryliag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @j82w)

Copy link
Copy Markdown
Contributor

@xinhaoz xinhaoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for fixing!

Problem:
The counters used to track the number of unique fingerprints we store
in-memory for sql stats were refactored in #110805. In change #110805
a bug was introduced where it incresease the memory instead of resetting
the counts. This causes the statstics to stop calculating new stats
once the limit is hit.

Solution:
Fix the bug by resetting the counters instead of increasing them. Added
new test to test the reset functionality.

Fixes: #111583

Release note (sql change): Fix a bug that causes the sql stats to stop
collecting new stats.
@j82w
Copy link
Copy Markdown
Contributor Author

j82w commented Oct 2, 2023

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Oct 3, 2023

Build failed:

@j82w
Copy link
Copy Markdown
Contributor Author

j82w commented Oct 3, 2023

bors retry

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Oct 3, 2023

Build failed:

@j82w
Copy link
Copy Markdown
Contributor Author

j82w commented Oct 3, 2023

bors retry

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Oct 3, 2023

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-23.1.x PAST MAINTENANCE SUPPORT: 23.1 patch releases via ER request only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sqlstats: counters for in-memory fingerprints never reset

4 participants