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

autoid_service: fix the result of NextGlobalAutoID() for AUTO_ID_CACHE=1 #46550

Merged
merged 1 commit into from
Aug 31, 2023

Conversation

tiancaiamao
Copy link
Contributor

@tiancaiamao tiancaiamao commented Aug 31, 2023

What problem does this PR solve?

Issue Number: close #46545

Problem Summary:

What is changed and how it works?

After #39041 the row id and auto increment id use different key.
Here IncrementID should be used.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)

Follow the step in issue #46545
It's not easy to integration test for this, since the bug need a tidb restart to trigger.
After the autoid service initialized, the cached value is used and the code logic does not go the buggy line.

https://github.com/pingcap/tidb/pull/46550/files#diff-617839a099f419c84781f44a2286d763780a446a701eac0a440c7c579378706cR457-R462

  • 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

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

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 31, 2023
@tiprow
Copy link

tiprow bot commented Aug 31, 2023

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. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Member

@YangKeao YangKeao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 31, 2023
@codecov
Copy link

codecov bot commented Aug 31, 2023

Codecov Report

Merging #46550 (b2f3de9) into master (187573b) will decrease coverage by 0.6503%.
Report is 8 commits behind head on master.
The diff coverage is 100.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #46550        +/-   ##
================================================
- Coverage   73.3358%   72.6855%   -0.6503%     
================================================
  Files          1310       1333        +23     
  Lines        394421     400982      +6561     
================================================
+ Hits         289252     291456      +2204     
- Misses        86761      91067      +4306     
- Partials      18408      18459        +51     
Flag Coverage Δ
integration 25.3910% <0.0000%> (?)
unit 73.3740% <100.0000%> (+0.0382%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 54.0444% <ø> (ø)
parser 84.9880% <ø> (ø)
br 48.0297% <ø> (-4.3251%) ⬇️

Copy link
Member

@bb7133 bb7133 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot
Copy link

ti-chi-bot bot commented Aug 31, 2023

[APPROVALNOTIFIER] This PR is APPROVED

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

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:

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 added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 31, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Aug 31, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-08-31 04:20:44.122828072 +0000 UTC m=+1987208.671844059: ☑️ agreed by YangKeao.
  • 2023-08-31 09:01:43.889500891 +0000 UTC m=+2004068.438516878: ☑️ agreed by bb7133.

@hawkingrei
Copy link
Member

/retest

@tiprow
Copy link

tiprow bot commented Aug 31, 2023

@tiancaiamao: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
tiprow_fast_test b2f3de9 link true /test tiprow_fast_test

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@ti-chi-bot ti-chi-bot bot merged commit 9c82229 into pingcap:master Aug 31, 2023
6 of 9 checks passed
@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

show table t next_row_id wrong result for AUTO_ID_CACHE=1
5 participants