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

lightning: revise the structure of table conflict_error_v1 and add index for faster search #45799

Merged
merged 2 commits into from
Aug 4, 2023

Conversation

lyzx2001
Copy link
Contributor

@lyzx2001 lyzx2001 commented Aug 3, 2023

What problem does this PR solve?

Issue Number: ref #45774

Problem Summary:

We need to support replace mode for lightning post-import conflict detection:
To resolve rows with conflict, instead of deleting all the rows that are engaged in conflict (the algorithm for remove), we delete some of the rows with conflict and reserve other rows that can be kept and not cause conflict anymore. Under this circumstance, we only delete the necessary rows to resolve conflicts, so that we can keep more original rows than remove mode as long as the conflicts are resolved.

What is changed and how it works?

This PR is the first step for implementing the replace algorithm.

I revised the structure of the table that record data KV conflicts and index KV conflicts, which is conflict_error_v1. I added index for index_name to track and search rows with conflicts faster in the later steps.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • 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. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 3, 2023
@codecov
Copy link

codecov bot commented Aug 3, 2023

Codecov Report

Merging #45799 (6a6954a) into master (522a008) will increase coverage by 0.0143%.
The diff coverage is 0.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #45799        +/-   ##
================================================
+ Coverage   73.3463%   73.3607%   +0.0143%     
================================================
  Files          1271       1274         +3     
  Lines        393001     393678       +677     
================================================
+ Hits         288252     288805       +553     
- Misses        86371      86468        +97     
- Partials      18378      18405        +27     
Flag Coverage Δ
integration 78.1388% <ø> (?)
unit 73.3524% <0.0000%> (+0.0061%) ⬆️

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

Components Coverage Δ
dumpling 54.0444% <ø> (ø)
parser 85.0467% <ø> (+0.0108%) ⬆️
br 52.0128% <0.0000%> (+0.0041%) ⬆️

@lance6716
Copy link
Contributor

/test pull-br-integration-test

@tiprow
Copy link

tiprow bot commented Aug 4, 2023

@lance6716: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test tiprow_fast_test

Use /test all to run all jobs.

In response to this:

/test pull-br-integration-test

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 needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Aug 4, 2023
merge master into issue45774-step1
@lyzx2001
Copy link
Contributor Author

lyzx2001 commented Aug 4, 2023

/cc @lichunzhu

@ti-chi-bot ti-chi-bot bot requested a review from lichunzhu August 4, 2023 03:40
@ti-chi-bot ti-chi-bot bot added the lgtm label Aug 4, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Aug 4, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lance6716, lichunzhu

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:
  • OWNERS [lance6716,lichunzhu]

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 Aug 4, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Aug 4, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-08-04 03:17:39.7878633 +0000 UTC m=+414543.730211832: ☑️ agreed by lance6716.
  • 2023-08-04 05:20:13.333470509 +0000 UTC m=+421897.275819030: ☑️ agreed by lichunzhu.

@ti-chi-bot ti-chi-bot bot merged commit 57d778f into pingcap:master Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm 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.

3 participants