pingcap / tidb

TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://www.pingcap.com/tidb-serverless/
https://pingcap.com
Apache License 2.0
36.39k stars 5.73k forks source link

autoid_service: remove the force rebase on close behavior #53315

Closed tiancaiamao closed 1 month ago

tiancaiamao commented 1 month ago

What problem does this PR solve?

Issue Number: ref #38442 close #53393

Problem Summary:

What changed and how does it work?

The original design is that we try our best to avoid holes in AUTO_ID_CACHE=1, so when autoid leader exit, forceRebase is called to return the non-consumed in memory IDs back.

When there are a lot of tables, this operation could not be finish quickly. And tidb graceful shutdown can not done within 30s. This cause tidb can not restart quickly to provide service.

We think over it and deside to remove the force rebase on close behavior.

Check List

Tests

No unit test apply here (it requires tidb restart to cover the changes). Some integration test may notice the change.

Side effects

Documentation

Behavior change, not tidb restart can cause hole in auto id allocating using AUTO_ID_CACHE=1

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None
tiprow[bot] commented 1 month ago

Hi @tiancaiamao. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 74.5497%. Comparing base (5d27b73) to head (39eee29). Report is 16 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #53315 +/- ## ================================================ + Coverage 72.4973% 74.5497% +2.0523% ================================================ Files 1497 1497 Lines 429959 429984 +25 ================================================ + Hits 311709 320552 +8843 + Misses 98996 89535 -9461 - Partials 19254 19897 +643 ``` | [Flag](https://app.codecov.io/gh/pingcap/tidb/pull/53315/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | Coverage Δ | | |---|---|---| | [integration](https://app.codecov.io/gh/pingcap/tidb/pull/53315/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `48.9945% <ø> (?)` | | | [unit](https://app.codecov.io/gh/pingcap/tidb/pull/53315/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `71.3025% <ø> (-0.0919%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap#carryforward-flags-in-the-pull-request-comment) to find out more. | [Components](https://app.codecov.io/gh/pingcap/tidb/pull/53315/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | Coverage Δ | | |---|---|---| | [dumpling](https://app.codecov.io/gh/pingcap/tidb/pull/53315/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `53.9957% <ø> (ø)` | | | [parser](https://app.codecov.io/gh/pingcap/tidb/pull/53315/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `∅ <ø> (∅)` | | | [br](https://app.codecov.io/gh/pingcap/tidb/pull/53315/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `50.1806% <ø> (+8.7515%)` | :arrow_up: |
ti-chi-bot[bot] commented 1 month ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bb7133, Defined2014

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

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[pkg/autoid_service/OWNERS](https://github.com/pingcap/tidb/blob/master/pkg/autoid_service/OWNERS)~~ [bb7133] 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[bot] commented 1 month ago

[LGTM Timeline notifier]

Timeline:

ti-chi-bot commented 4 weeks ago

In response to a cherrypick label: new pull request created to branch release-8.1: #53396.