Skip to content

Conversation

tangenta
Copy link
Contributor

@tangenta tangenta commented Nov 22, 2023

What problem does this PR solve?

Issue Number: close #48804

Problem Summary:

When ResetEngine failed because of timestamp allocation error like PD:tso:ErrGenerateTimestamp, the engine manager is not cleaned. In the next retry, engine manager invokes ImportEngine again, leaving backend.TS as the zero value.

if err = local.allocateTSIfNotExists(ctx, localEngine); err != nil {
return errors.Trace(err)
}


[2023/11/21 22:19:52.937 +08:00] [ERROR] [backend.go:222] ["ingest data into storage error"] ["index ID"=15] ["usage info"="disk usage: 100037206016/1968786661376, backend usage: 0"]
[2023/11/21 22:19:52.937 +08:00] [ERROR] [pd.go:236] ["updateTS error"] [txnScope=global] [error="rpc error: code = Unknown desc = [PD:tso:ErrGenerateTimestamp]generate timestamp failed, requested pd is not leader of cluster"]

What is changed and how it works?

This PR sets both engineInfo.openEngine and engineInfo.closedEngine to nil if there is an error during ResetEngine. In the next retry, engine manager will open a new backend and allocate TS.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

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 do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-triage-completed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 22, 2023
Copy link

tiprow bot commented Nov 22, 2023

Hi @tangenta. 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

codecov bot commented Nov 22, 2023

Codecov Report

Merging #48797 (dd25e00) into master (9062834) will increase coverage by 1.5791%.
Report is 10 commits behind head on master.
The diff coverage is 10.2564%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #48797        +/-   ##
================================================
+ Coverage   71.0864%   72.6656%   +1.5791%     
================================================
  Files          1365       1391        +26     
  Lines        404572     411244      +6672     
================================================
+ Hits         287596     298833     +11237     
+ Misses        97010      93525      -3485     
+ Partials      19966      18886      -1080     
Flag Coverage Δ
integration 43.4961% <0.0000%> (?)
unit 71.1031% <10.5263%> (+0.0166%) ⬆️

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

Components Coverage Δ
dumpling 53.9663% <ø> (ø)
parser ∅ <ø> (∅)
br 48.7445% <40.0000%> (-4.2300%) ⬇️

@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. do-not-merge/needs-tests-checked do-not-merge/needs-linked-issue do-not-merge/needs-triage-completed labels Nov 22, 2023
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Nov 22, 2023
Copy link
Collaborator

@Benjamin2037 Benjamin2037 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

ti-chi-bot bot commented Nov 22, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Benjamin2037, wjhuang2016

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 approved lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Nov 22, 2023
Copy link

ti-chi-bot bot commented Nov 22, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-11-22 10:18:08.014836473 +0000 UTC m=+399516.680062751: ☑️ agreed by wjhuang2016.
  • 2023-11-22 10:20:43.724098686 +0000 UTC m=+399672.389324883: ☑️ agreed by Benjamin2037.

Copy link
Contributor

@D3Hunter D3Hunter left a comment

Choose a reason for hiding this comment

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

rest lgtm

@Benjamin2037
Copy link
Collaborator

/retest

@ti-chi-bot ti-chi-bot bot merged commit d2cfbde into pingcap:master Nov 22, 2023
@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Nov 22, 2023
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-7.5 Should cherry pick this PR to release-7.5 branch. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

more than one tikv panic repeatedly and service is unavailable when run workload and add index
5 participants