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

min start ts of initStatsCtx is not tracked #53592

Closed
you06 opened this issue May 27, 2024 · 0 comments · Fixed by #53602
Closed

min start ts of initStatsCtx is not tracked #53592

you06 opened this issue May 27, 2024 · 0 comments · Fixed by #53602

Comments

@you06
Copy link
Contributor

you06 commented May 27, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

tidb/pkg/session/session.go

Lines 3510 to 3514 in 2300ac6

// setup init stats loader
initStatsCtx, err := createSession(store)
if err != nil {
return nil, err
}

The min start ts will block gc to guarantee the ongoing transaction can see its data, but the min start ts of initStatsCtx is not tracked.

1. Minimal reproduce step (Required)

Inject 30min sleep when loading stats in init context.

See commit.

2. What did you expect to see? (Required)

Stats loaded after 30min.

3. What did you see instead (Required)

[2024/05/27 21:08:25.631 +09:00] [ERROR] [domain.go:2314] ["init stats info failed"] [lite=true] ["take time"=30m0.002233833s] [error="[tikv:9006]GC life time is shorter than transaction duration, transaction starts at 2024-05-27 20:38:25.628 +0900 JST, GC safe point is 2024-05-27 20:49:25.682 +0900 JST"]

4. What is your TiDB version? (Required)

f5ac93e

@you06 you06 added the type/bug This issue is a bug. label May 27, 2024
you06 added a commit to you06/tidb that referenced this issue May 27, 2024
Signed-off-by: you06 <you1474600@gmail.com>
@jebter jebter added sig/planner SIG: Planner affects-7.5 and removed sig/sql-infra SIG: SQL Infra labels May 28, 2024
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this issue May 29, 2024
Signed-off-by: you06 <you1474600@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants