Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlstats: fix counter for in-memory fingerprints #111613

Merged
merged 1 commit into from Oct 3, 2023
Merged

sqlstats: fix counter for in-memory fingerprints #111613

merged 1 commit into from Oct 3, 2023

Conversation

j82w
Copy link
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 as a code owner October 2, 2023 20:42
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@j82w j82w added the backport-23.1.x Flags PRs that need to be backported to 23.1 label Oct 2, 2023
Copy link
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
Member

@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
Contributor Author

j82w commented Oct 2, 2023

bors r+

@craig
Copy link
Contributor

craig bot commented Oct 3, 2023

Build failed:

@j82w
Copy link
Contributor Author

j82w commented Oct 3, 2023

bors retry

@craig
Copy link
Contributor

craig bot commented Oct 3, 2023

Build failed:

@j82w
Copy link
Contributor Author

j82w commented Oct 3, 2023

bors retry

@craig
Copy link
Contributor

craig bot commented Oct 3, 2023

Build succeeded:

@craig craig bot merged commit 412a6c3 into cockroachdb:master Oct 3, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-23.1.x Flags PRs that need to be backported to 23.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sqlstats: counters for in-memory fingerprints never reset
4 participants