Skip to content

gc: fix NumKeysAffected counting more than collected#84165

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
aliher1911:rts_gc_00
Jul 11, 2022
Merged

gc: fix NumKeysAffected counting more than collected#84165
craig[bot] merged 1 commit intocockroachdb:masterfrom
aliher1911:rts_gc_00

Conversation

@aliher1911
Copy link
Copy Markdown
Contributor

@aliher1911 aliher1911 commented Jul 11, 2022

Previously if key is not collected after a GC batch is sent out
it would still be included as affected in GC stats.
Those stats are mostly used for logging and tests, the unfortunate
effect is that randomized test could fail.
This commit fixes the bug.

Release note: None

Fixes #84164

@aliher1911 aliher1911 self-assigned this Jul 11, 2022
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Previously if key is not collected after a GC batch is sent out
it would still be included as affected in GC stats.
Those stats are mostly used for logging and tests, the unfortunate
effect is that randomized test could fail.
This commit fixes the bug.

Release note: None
@aliher1911 aliher1911 marked this pull request as ready for review July 11, 2022 10:46
@aliher1911 aliher1911 requested a review from a team as a code owner July 11, 2022 10:46
@aliher1911 aliher1911 requested review from erikgrinaker and tbg July 11, 2022 10:46
Copy link
Copy Markdown
Contributor

@erikgrinaker erikgrinaker left a comment

Choose a reason for hiding this comment

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

Thanks!

@aliher1911
Copy link
Copy Markdown
Contributor Author

bors r=erikgrinaker

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jul 11, 2022

Build succeeded:

@craig craig bot merged commit bef1101 into cockroachdb:master Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gc.Info.AffectedKeys is not updated correctly by gc.Run in come cases.

3 participants