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
runtime: long latency of sweep assists #57523
Comments
CC @golang/runtime. |
Thanks for the detailed report and investigation!
Yeah, this just seems like a bug, and like it would cause exactly this latency issue. We should just check for overflow defensively. I think that code assumes that However, if your application is calling Does TiDB call |
Got it, thanks. Then I think I'm satisfied with calls to these functions as the complete explanation for how we can see this overflow. I'll send out a patch shortly. |
Actually, looking again at your execution trace, the fact that so many goroutines get stuck in sweep assist all at the same time is suspicious. There is another facet to this story and I think it's the fact that That's how we can get into this persistently bad state. |
Sent for review: https://go.dev/cl/460376 |
Change https://go.dev/cl/460376 mentions this issue: |
An interesting question is whether this is bad enough to deserve a backport. The fix is very small and pretty safe. |
Thank you for your prompt response, @mknyszek . The issue seems to be related to the calling of |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Not sure, but at least with v1.19.1.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I'm investigating a long tail latency issue of tidb and found that it's sweep assists that lead to those slow queries.
I also added a debug log and found that the
heapLive
might be less than thesweepHeapLiveBasis
here. As a result, we got a extremely largepagesTarget
(because of underflow) and then spent a lot of time on sweeping (need to sweep 2767037498505953 pages for allocating 8192 bytes).What did you expect to see?
reasonable latency of sweep assists.
What did you see instead?
it takes hundreds of milliseconds for
deductSweepCredit
.The text was updated successfully, but these errors were encountered: