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: provide view for users when using conflict detection #53289

Merged
merged 8 commits into from
May 21, 2024

Conversation

lyzx2001
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #52393

Problem Summary:

What changed and how does it work?

Provide view for users regardless of the lightning configuration.

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.

For lightning conflict detection "replace" mode, the conflicting data are recorded in the `lightning_task_info.conflict_view` view of the target TiDB cluster.
If the value for column is_precheck_conflict is 0, it stands for conflicting data detected by post-import conflict detection in the physical import mode; If the value for column is_precheck_conflict is 1, it stands for conflicting data detected by preprocess conflict detection in both logical and physical import modes.

@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 15, 2024
Copy link

tiprow bot commented May 15, 2024

Hi @lyzx2001. 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-sigs/prow repository.

@lyzx2001
Copy link
Contributor Author

/test pull-lightning-integration-test

Copy link

tiprow bot commented May 15, 2024

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

In response to this:

/test pull-lightning-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-sigs/prow repository.

Copy link

codecov bot commented May 15, 2024

Codecov Report

Attention: Patch coverage is 57.14286% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 73.8923%. Comparing base (fa94f49) to head (c1b6312).
Report is 65 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #53289        +/-   ##
================================================
+ Coverage   72.4109%   73.8923%   +1.4814%     
================================================
  Files          1493       1546        +53     
  Lines        429341     453630     +24289     
================================================
+ Hits         310890     335198     +24308     
+ Misses        99162      97597      -1565     
- Partials      19289      20835      +1546     
Flag Coverage Δ
integration 50.6486% <57.1428%> (?)
unit 71.3458% <28.5714%> (+0.0429%) ⬆️

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

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 42.0730% <ø> (+0.6361%) ⬆️

@lyzx2001
Copy link
Contributor Author

/test pull-lightning-integration-test

Copy link

tiprow bot commented May 17, 2024

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

In response to this:

/test pull-lightning-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-sigs/prow repository.

@lyzx2001 lyzx2001 changed the title [WIP] lightning: provide view for users when using conflict detection lightning: provide view for users when using conflict detection May 17, 2024
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 17, 2024
@lyzx2001
Copy link
Contributor Author

/test pull-lightning-integration-test

@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 17, 2024
Copy link

tiprow bot commented May 17, 2024

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

In response to this:

/test pull-lightning-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-sigs/prow repository.

@lyzx2001
Copy link
Contributor Author

/cc @lance6716 @D3Hunter

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

# You can manually insert the correct records into the target table based on your business requirements.
# Note that the target TiKV must be v5.2.0 or later versions; otherwise it falls back to 'none'.
# The default value is 'none'.
# duplicate-resolution = 'none'
Copy link
Contributor

Choose a reason for hiding this comment

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

recovering old config? there is a record option

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I deleted the old config in #51710
But we should mark them as deprecated rather than directly delete them, so I add them back here marked as deprecated.
https://docs.pingcap.com/tidb/v8.0/tidb-lightning-configuration
The doc also marks them as deprecated rather than directly delete them.

The record option was only for internal use and was not declared in the older documentation for users, so I think we do not need to add it here either.
https://docs.pingcap.com/tidb/stable/tidb-lightning-configuration

Copy link
Contributor

Choose a reason for hiding this comment

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

"deprecated" means the configuration value is not recommended but still takes effect. But duplicate-resolution = "remove" does not take effect.

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label May 20, 2024
@lyzx2001
Copy link
Contributor Author

/cc @yudongusa @easonn7

Copy link

ti-chi-bot bot commented May 20, 2024

@lyzx2001: GitHub didn't allow me to request PR reviews from the following users: yudongusa, easonn7.

Note that only pingcap members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @yudongusa @easonn7

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
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.

rest lgtm

# You can manually insert the correct records into the target table based on your business requirements.
# Note that the target TiKV must be v5.2.0 or later versions; otherwise it falls back to 'none'.
# The default value is 'none'.
# duplicate-resolution = 'none'
Copy link
Contributor

Choose a reason for hiding this comment

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

"deprecated" means the configuration value is not recommended but still takes effect. But duplicate-resolution = "remove" does not take effect.

@lyzx2001
Copy link
Contributor Author

rest lgtm

modified

@lyzx2001 lyzx2001 requested a review from lance6716 May 20, 2024 07:53
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels May 21, 2024
Copy link

ti-chi-bot bot commented May 21, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-05-20 02:41:51.923139512 +0000 UTC m=+2053065.680275085: ☑️ agreed by D3Hunter.
  • 2024-05-21 06:31:03.92279727 +0000 UTC m=+2153217.679932843: ☑️ agreed by lance6716.

@lyzx2001
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented May 21, 2024

@lyzx2001: 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-sigs/prow repository.

@easonn7
Copy link

easonn7 commented May 21, 2024

/approve

Copy link

ti-chi-bot bot commented May 21, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: D3Hunter, easonn7, lance6716

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 May 21, 2024
@ti-chi-bot ti-chi-bot bot merged commit 67531d0 into pingcap:master May 21, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

Optimize lightning conflict recording tables
4 participants