Skip to content

Storage: Fix init_thread_count_scale == 0, tiflash can not start normally (#9905)#9912

Merged
ti-chi-bot[bot] merged 4 commits intopingcap:release-8.1from
ti-chi-bot:cherry-pick-9905-to-release-8.1
Feb 25, 2025
Merged

Storage: Fix init_thread_count_scale == 0, tiflash can not start normally (#9905)#9912
ti-chi-bot[bot] merged 4 commits intopingcap:release-8.1from
ti-chi-bot:cherry-pick-9905-to-release-8.1

Conversation

@ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #9905

What problem does this PR solve?

Issue Number: close #9906

Problem Summary:

If profiles.default.init_thread_count_scale to 0, tiflash stuck at loading metadata because we try to add task into a thread pool with num_thread == 0.

What is changed and how it works?

* If `profiles.default.init_thread_count_scale == 0`, run `loadMetadata` and `BgStorageInit` in serial order.
* Respect `terminate_signals_counter` in `BGStorageInit`

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
    deploy a cluster and add this config line to tiflash by tiup edit-config
    profiles.default.init_thread_count_scale: 0
[2025/02/24 16:14:18.240 +08:00] [INFO] [BgStorageInit.cpp:181] ["Lazily init store"] [thread_id=1]
[2025/02/24 16:14:18.361 +08:00] [INFO] [BgStorageInit.cpp:138] ["Init stores without thread pool"] [thread_id=77]
[2025/02/24 16:17:35.796 +08:00] [INFO] [BgStorageInit.cpp:158] ["Storage inited finish. total_count=60258 init_count=57697 error_count=0 terminated=0 datatype_fullname_count=24"] [thread_id=77]
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/cherry-pick-for-release-8.1 This PR is cherry-picked to release-8.1 from a source PR. labels Feb 25, 2025
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Feb 25, 2025
@ti-chi-bot ti-chi-bot bot added the lgtm label Feb 25, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Feb 25, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JaySon-Huang, Lloyd-Pottiger

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [JaySon-Huang,Lloyd-Pottiger]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Feb 25, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Feb 25, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-02-25 04:59:45.47035957 +0000 UTC m=+331933.423517821: ☑️ agreed by JaySon-Huang.
  • 2025-02-25 06:08:21.184622811 +0000 UTC m=+336049.137781070: ☑️ agreed by Lloyd-Pottiger.

@ti-chi-bot ti-chi-bot bot merged commit af890e6 into pingcap:release-8.1 Feb 25, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved cherry-pick-approved Cherry pick PR approved by release team. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/cherry-pick-for-release-8.1 This PR is cherry-picked to release-8.1 from a source PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants