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 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. 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.

@winoros winoros added type/bug The issue is confirmed as a bug. sig/planner SIG: Planner severity/major affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. labels Apr 1, 2024
@ti-chi-bot ti-chi-bot bot added may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 labels Apr 1, 2024
@winoros winoros removed may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 labels Apr 1, 2024
@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 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. 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