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

ddl: add import failed test for adding index #48271

Merged
merged 6 commits into from
Nov 3, 2023

Conversation

tangenta
Copy link
Contributor

@tangenta tangenta commented Nov 3, 2023

What problem does this PR solve?

Issue Number: close #47967

Problem Summary:

When TiDB encounters a lightning import error, ImportAndClean does not clean the engine.

// Ingest data to TiKV.
logutil.Logger(ei.ctx).Info(LitInfoStartImport, zap.Int64("job ID", ei.jobID),
zap.Int64("index ID", ei.indexID),
zap.String("split region size", strconv.FormatInt(int64(config.SplitRegionSize), 10)))
err = closeEngine.Import(ei.ctx, int64(config.SplitRegionSize), int64(config.SplitRegionKeys))
if err != nil {
logLevel := zap.ErrorLevel
if common.ErrFoundDuplicateKeys.Equal(err) {
logLevel = zap.WarnLevel
}
logutil.Logger(ei.ctx).Log(logLevel, LitErrIngestDataErr, zap.Error(err),
zap.Int64("job ID", ei.jobID), zap.Int64("index ID", ei.indexID))
return err
}
// Clean up the engine local workspace.
err = closeEngine.Cleanup(ei.ctx)
if err != nil {

On the next retry, opening the new engine will encounter the "lock held by the current process" error reported by pebble.

What is changed and how it works?

Before opening a new engine, check if there is a closed engine and import data if possible.

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 release-note-none Denotes a PR that doesn't merit a release note. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 3, 2023
Copy link

tiprow bot commented Nov 3, 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 3, 2023

Codecov Report

Merging #48271 (aa5372a) into master (4061df3) will increase coverage by 1.3096%.
Report is 1 commits behind head on master.
The diff coverage is 3.7735%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #48271        +/-   ##
================================================
+ Coverage   71.4902%   72.7998%   +1.3096%     
================================================
  Files          1402       1425        +23     
  Lines        406282     412689      +6407     
================================================
+ Hits         290452     300437      +9985     
+ Misses        95996      93342      -2654     
+ Partials      19834      18910       -924     
Flag Coverage Δ
integration 42.7157% <1.8867%> (?)
unit 71.4895% <3.7735%> (-0.0008%) ⬇️

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

Components Coverage Δ
dumpling 53.9874% <ø> (ø)
parser ∅ <ø> (∅)
br 48.6729% <0.0000%> (-4.2819%) ⬇️

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Nov 3, 2023
@tangenta
Copy link
Contributor Author

tangenta commented Nov 3, 2023

/retest

Copy link

tiprow bot commented Nov 3, 2023

@tangenta: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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.

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Nov 3, 2023
Copy link

ti-chi-bot bot commented Nov 3, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-11-03 08:01:49.933193117 +0000 UTC m=+3199307.520303262: ☑️ agreed by wjhuang2016.
  • 2023-11-03 08:27:36.82378578 +0000 UTC m=+3200854.410895926: ☑️ agreed by ywqzzy.

Copy link
Contributor

@lance6716 lance6716 left a comment

Choose a reason for hiding this comment

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

lgtm for lightning part

Copy link

ti-chi-bot bot commented Nov 3, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lance6716, wjhuang2016, ywqzzy

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 the approved label Nov 3, 2023
@ti-chi-bot ti-chi-bot bot merged commit d2c0c6e into pingcap:master Nov 3, 2023
@ti-chi-bot
Copy link
Member

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

ti-chi-bot bot pushed a commit that referenced this pull request Nov 9, 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.

add index failed with cancelled error
5 participants