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

wrong singleflight implementation for stats' syncload #52294

Closed
winoros opened this issue Apr 1, 2024 · 2 comments · Fixed by #52301
Closed

wrong singleflight implementation for stats' syncload #52294

winoros opened this issue Apr 1, 2024 · 2 comments · Fixed by #52301
Labels
affects-6.5 affects-7.1 affects-7.5 report/customer Customers have encountered this bug. severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@winoros
Copy link
Member

winoros commented Apr 1, 2024

Bug Report

image
We use the setWorking for sync load's duplicate task detection.
image
It will return a boolean value directly after it finds duplicates.
image
And we can see that the writeToResultChan also returns directly by writing an ok result to the resultCh.

So the duplicated task will directly return without waiting for the executing one to finish.

As a result, if there are two TiDB nodes and we run sysbench's select_random_points with more than 2 threads, we will find out the following slow query:
image
The sync load doesn't timeout but we still have the SQLs executed without stats.
Such a slow query would disappear if the thread number is equal to or less than 2.

@seiya-annie
Copy link

/found customer

1 similar comment
@seiya-annie
Copy link

/found customer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.5 affects-7.1 affects-7.5 report/customer Customers have encountered this bug. severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants