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

OOM in the ClearOutdatedHistoryStats #48431

Closed
hawkingrei opened this issue Nov 8, 2023 · 1 comment · Fixed by #48430
Closed

OOM in the ClearOutdatedHistoryStats #48431

hawkingrei opened this issue Nov 8, 2023 · 1 comment · Fixed by #48430
Labels
affects-7.1 affects-7.5 component/statistics report/community The community has encountered this bug. severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@hawkingrei
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

img_v3_0250_170a3ec3-60f0-4818-867d-95b5574e1c8g

goroutine 1464 [chan receive]:
[github.com/pingcap/tidb/pkg/executor.(*IndexLookUpExecutor).getResultTask(0xc1b9227180)](https://github.com/pingcap/tidb/pkg/executor.(*IndexLookUpExecutor).getResultTask(0xc1b9227180))
    /home/jenkins/agent/workspace/build-common/go/src/[github.com/pingcap/tidb/pkg/executor/distsql.go:904](https://github.com/pingcap/tidb/pkg/executor/distsql.go:904) +0x105
[github.com/pingcap/tidb/pkg/executor.(*IndexLookUpExecutor).Next](https://github.com/pingcap/tidb/pkg/executor.(*IndexLookUpExecutor).Next)(0xc1b9227180, {0x62f3c50?, 0xc0d1bac840?}, 0xc159e0ccd0)
    /home/jenkins/agent/workspace/build-common/go/src/[github.com/pingcap/tidb/pkg/executor/distsql.go:867](https://github.com/pingcap/tidb/pkg/executor/distsql.go:867) +0xd5
[github.com/pingcap/tidb/pkg/executor/internal/exec.Next](https://github.com/pingcap/tidb/pkg/executor/internal/exec.Next)({0x62f3c50, 0xc0d1bac840}, {0x6309910, 0xc1b9227180}, 0xc159e0ccd0)
    /home/jenkins/agent/workspace/build-common/go/src/[github.com/pingcap/tidb/pkg/executor/internal/exec/executor.go:278](https://github.com/pingcap/tidb/pkg/executor/internal/exec/executor.go:278) +0x2ba
[github.com/pingcap/tidb/pkg/executor.(*DeleteExec).deleteSingleTableByChunk](https://github.com/pingcap/tidb/pkg/executor.(*DeleteExec).deleteSingleTableByChunk)(0xc05a5cab40, {0x62f3c50, 0xc0d1bac840})
    /home/jenkins/agent/workspace/build-common/go/src/[github.com/pingcap/tidb/pkg/executor/delete.go:113](https://github.com/pingcap/tidb/pkg/executor/delete.go:113) +0x665
[github.com/pingcap/tidb/pkg/executor.(*DeleteExec).Next](https://github.com/pingcap/tidb/pkg/executor.(*DeleteExec).Next)(0x62f3c50?, {0x62f3c50?, 0xc0d1bac840?}, 0x1?)
    /home/jenkins/agent/workspace/build-common/go/src/[github.com/pingcap/tidb/pkg/executor/delete.go:61](https://github.com/pingcap/tidb/pkg/executor/delete.go:61) +0x65
[github.com/pingcap/tidb/pkg/executor/internal/exec.Next](https://github.com/pingcap/tidb/pkg/executor/internal/exec.Next)({0x62f3c50, 0xc0d1bac840}, {0x630a830, 0xc05a5cab40}, 0xc159e0cb90)
    /home/jenkins/agent/workspace/build-common/go/src/[github.com/pingcap/tidb/pkg/executor/internal/exec/executor.go:278](https://github.com/pingcap/tidb/pkg/executor/internal/exec/executor.go:278) +0x2ba
[github.com/pingcap/tidb/pkg/executor.(*ExecStmt).next](https://github.com/pingcap/tidb/pkg/executor.(*ExecStmt).next)(0xc071e7ce10, {0x62f3c50, 0xc0d1bac840}, {0x630a830, 0xc05a5cab40}, 0x0?)
    /home/jenkins/agent/workspace/build-common/go/src/[github.com/pingcap/tidb/pkg/executor/adapter.go:1226](https://github.com/pingcap/tidb/pkg/executor/adapter.go:1226) +0x6e
[github.com/pingcap/tidb/pkg/executor.(*ExecStmt).handleNoDelayExecutor](https://github.com/pingcap/tidb/pkg/executor.(*ExecStmt).handleNoDelayExecutor)(0xc071e7ce10, {0x62f3c50?, 0xc0d1bac840?}, {0x630a830?, 0xc05a5cab40})
    /home/jenkins/agent/workspace/build-common/go/src/[github.com/pingcap/tidb/pkg/executor/adapter.go:971](https://github.com/pingcap/tidb/pkg/executor/adapter.go:971) +0x396
[github.com/pingcap/tidb/pkg/executor.(*ExecStmt).handleNoDelay](https://github.com/pingcap/tidb/pkg/executor.(*ExecStmt).handleNoDelay)(0xc071e7ce10, {0x62f3c50, 0xc0d1bac840}, {0x630a830?, 0xc05a5cab40?}, 0x0)
    /home/jenkins/agent/workspace/build-common/go/src/[github.com/pingcap/tidb/pkg/executor/adapter.go:797](https://github.com/pingcap/tidb/pkg/executor/adapter.go:797) +0x252
[github.com/pingcap/tidb/pkg/executor.(*ExecStmt).Exec](https://github.com/pingcap/tidb/pkg/executor.(*ExecStmt).Exec)(0xc071e7ce10, {0x62f3c50, 0xc0d1bac840})
    /home/jenkins/agent/workspace/build-common/go/src/[github.com/pingcap/tidb/pkg/executor/adapter.go:578](https://github.com/pingcap/tidb/pkg/executor/adapter.go:578) +0xda5
[github.com/pingcap/tidb/pkg/session.runStmt](https://github.com/pingcap/tidb/pkg/session.runStmt)({0x62f3c50?, 0xc000ea0270?}, 0xc0669d4780, {0x6303700, 0xc071e7ce10?})
    /home/jenkins/agent/workspace/build-common/go/src/[github.com/pingcap/tidb/pkg/session/session.go:2421](https://github.com/pingcap/tidb/pkg/session/session.go:2421) +0x422
[github.com/pingcap/tidb/pkg/session.(*session).ExecuteStmt](https://github.com/pingcap/tidb/pkg/session.(*session).ExecuteStmt)(0xc0669d4780, {0x62f3c50?, 0xc000ea0270?}, {0x6308298?, 0xc08967b040?})
    /home/jenkins/agent/workspace/build-common/go/src/[github.com/pingcap/tidb/pkg/session/session.go:2271](https://github.com/pingcap/tidb/pkg/session/session.go:2271) +0x109b
[github.com/pingcap/tidb/pkg/session.(*session).ExecuteInternal](https://github.com/pingcap/tidb/pkg/session.(*session).ExecuteInternal)(0xc0669d4780, {0x62f3c50, 0xc000ea0270}, {0x5a9c7be, 0x6b}, {0xc01eb7c7e0, 0x1, 0x1})
    /home/jenkins/agent/workspace/build-common/go/src/[github.com/pingcap/tidb/pkg/session/session.go:1645](https://github.com/pingcap/tidb/pkg/session/session.go:1645) +0x23e
[github.com/pingcap/tidb/pkg/statistics/handle/util.Exec](https://github.com/pingcap/tidb/pkg/statistics/handle/util.Exec)({0x636c1d8?, 0xc0669d4780?}, {0x5a9c7be, 0x6b}, {0xc01eb7c7e0, 0x1, 0x1})
    /home/jenkins/agent/workspace/build-common/go/src/[github.com/pingcap/tidb/pkg/statistics/handle/util/util.go:203](https://github.com/pingcap/tidb/pkg/statistics/handle/util/util.go:203) +0x8c
[github.com/pingcap/tidb/pkg/statistics/handle/storage.ClearOutdatedHistoryStats](https://github.com/pingcap/tidb/pkg/statistics/handle/storage.ClearOutdatedHistoryStats)({0x636c1d8, 0xc0669d4780})
    /home/jenkins/agent/workspace/build-common/go/src/[github.com/pingcap/tidb/pkg/statistics/handle/storage/gc.go:191](https://github.com/pingcap/tidb/pkg/statistics/handle/storage/gc.go:191) +0x39e
[github.com/pingcap/tidb/pkg/statistics/handle/storage.GCStats](https://github.com/pingcap/tidb/pkg/statistics/handle/storage.GCStats)({0x636c1d8, 0xc0669d4780}, {0x6375170?, 0xc067418a00}, {0x63304f0, 0xc0061b4200}, 0xa7a358200)
    /home/jenkins/agent/workspace/build-common/go/src/[github.com/pingcap/tidb/pkg/statistics/handle/storage/gc.go:119](https://github.com/pingcap/tidb/pkg/statistics/handle/storage/gc.go:119) +0x59f
[github.com/pingcap/tidb/pkg/statistics/handle/storage.(*statsGCImpl).GCStats.func1](https://github.com/pingcap/tidb/pkg/statistics/handle/storage.(*statsGCImpl).GCStats.func1)({0x636c1d8?, 0xc0669d4780?})
    /home/jenkins/agent/workspace/build-common/go/src/[github.com/pingcap/tidb/pkg/statistics/handle/storage/gc.go:57](https://github.com/pingcap/tidb/pkg/statistics/handle/storage/gc.go:57) +0x34
[github.com/pingcap/tidb/pkg/statistics/handle/util.CallWithSCtx](https://github.com/pingcap/tidb/pkg/statistics/handle/util.CallWithSCtx)({0x62cf7d0, 0xc0014060f0}, 0xc065cabb00, {0x0, 0x0, 0xc065cabb28?})
    /home/jenkins/agent/workspace/build-common/go/src/[github.com/pingcap/tidb/pkg/statistics/handle/util/util.go:110](https://github.com/pingcap/tidb/pkg/statistics/handle/util/util.go:110) +0x194
[github.com/pingcap/tidb/pkg/statistics/handle/storage.(*statsGCImpl).GCStats](https://github.com/pingcap/tidb/pkg/statistics/handle/storage.(*statsGCImpl).GCStats)(0xc047dc6ef0, {0x63304f0, 0xc0061b4200}, 0xa7a358200)
    /home/jenkins/agent/workspace/build-common/go/src/[github.com/pingcap/tidb/pkg/statistics/handle/storage/gc.go:56](https://github.com/pingcap/tidb/pkg/statistics/handle/storage/gc.go:56) +0x96
[github.com/pingcap/tidb/pkg/domain.(*Domain).updateStatsWorker](https://github.com/pingcap/tidb/pkg/domain.(*Domain).updateStatsWorker)(0xc001436000, {0x0?, 0x0?}, {0x63159c0?, 0xc0676cd900?})
    /home/jenkins/agent/workspace/build-common/go/src/[github.com/pingcap/tidb/pkg/domain/domain.go:2438](https://github.com/pingcap/tidb/pkg/domain/domain.go:2438) +0x7f9
[github.com/pingcap/tidb/pkg/domain.(*Domain).UpdateTableStatsLoop.func3()](https://github.com/pingcap/tidb/pkg/domain.(*Domain).UpdateTableStatsLoop.func3())
    /home/jenkins/agent/workspace/build-common/go/src/[github.com/pingcap/tidb/pkg/domain/domain.go:2257](https://github.com/pingcap/tidb/pkg/domain/domain.go:2257) +0x27
[github.com/pingcap/tidb/pkg/util.(*WaitGroupEnhancedWrapper).Run.func1()](https://github.com/pingcap/tidb/pkg/util.(*WaitGroupEnhancedWrapper).Run.func1())
    /home/jenkins/agent/workspace/build-common/go/src/[github.com/pingcap/tidb/pkg/util/wait_group_wrapper.go:96](https://github.com/pingcap/tidb/pkg/util/wait_group_wrapper.go:96) +0x6c
created by [github.com/pingcap/tidb/pkg/util.(*WaitGroupEnhancedWrapper).Run](https://github.com/pingcap/tidb/pkg/util.(*WaitGroupEnhancedWrapper).Run) in goroutine 1
    /home/jenkins/agent/workspace/build-common/go/src/[github.com/pingcap/tidb/pkg/util/wait_group_wrapper.go:91](https://github.com/pingcap/tidb/pkg/util/wait_group_wrapper.go:91) +0xbd

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

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

@hawkingrei hawkingrei added type/bug The issue is confirmed as a bug. component/statistics severity/major labels Nov 8, 2023
@ti-chi-bot ti-chi-bot bot added may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 may-affects-7.5 labels Nov 8, 2023
@hawkingrei hawkingrei added affects-7.1 affects-6.5 and removed may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 labels Nov 8, 2023
@jebter jebter added the sig/planner SIG: Planner label Nov 9, 2023
@seiya-annie
Copy link

/found community

@ti-chi-bot ti-chi-bot bot added the report/community The community has encountered this bug. label Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.1 affects-7.5 component/statistics report/community The community has 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.

3 participants