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: add WithDupIndicator to expose status to caller #39461

Merged
merged 25 commits into from
Dec 1, 2022

Conversation

lance6716
Copy link
Contributor

@lance6716 lance6716 commented Nov 29, 2022

Signed-off-by: lance6716 lance6716@gmail.com

What problem does this PR solve?

Issue Number: close #xxx

Problem Summary:

When use lightning as a library, it's more elegant to expose the internal status to caller by a variable than query a table in downstream

What is changed and how it works?

Check List

Tests

                        "errors": [
                            {
                                "ErrCode": 34019,
                                "ErrClass": "load-unit",
                                "ErrScope": "internal",
                                "ErrLevel": "medium",
                                "Message": "physical import finished but the data has duplication, please check `lightning_task_info`.`conflict_error_v1` to see the duplication.",
                                "RawCause": "",
                                "Workaround": "You can refer to https://docs.pingcap.com/tidb/stable/tidb-lightning-physical-import-mode-usage#conflict-detection to manually insert data and resume the task."
                            }
  • 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

Signed-off-by: lance6716 <lance6716@gmail.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Nov 29, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • buchuitoudegou
  • gozssky

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 29, 2022
Signed-off-by: lance6716 <lance6716@gmail.com>
@ti-chi-bot ti-chi-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 29, 2022
Signed-off-by: lance6716 <lance6716@gmail.com>
@lance6716 lance6716 changed the title lightning: add WithDupIndicator to expose status to caller [WIP]lightning: add WithDupIndicator to expose status to caller Nov 30, 2022
@ti-chi-bot ti-chi-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 30, 2022
@lance6716 lance6716 changed the title [WIP]lightning: add WithDupIndicator to expose status to caller lightning: add WithDupIndicator to expose status to caller Nov 30, 2022
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 30, 2022
@lance6716 lance6716 requested review from D3Hunter and buchuitoudegou and removed request for D3Hunter November 30, 2022 02:24
@lance6716
Copy link
Contributor Author

/cc @gozssky

@@ -263,6 +264,8 @@ type ControllerParam struct {
CheckpointStorage storage.ExternalStorage
// when CheckpointStorage is not nil, save file checkpoint to it with this name
CheckpointName string
// DupIndicator can expose the duplicate detection result to the caller
DupIndicator *bool
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe atomic.Bool is better. If we are importing multiple tables, this field may be set concurrently.

Signed-off-by: lance6716 <lance6716@gmail.com>
@sleepymole sleepymole added the component/lightning This issue is related to Lightning of TiDB. label Nov 30, 2022
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 30, 2022
Signed-off-by: lance6716 <lance6716@gmail.com>
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Nov 30, 2022
Co-authored-by: Obliviate <756541536@qq.com>
@lance6716
Copy link
Contributor Author

/merge

@lance6716
Copy link
Contributor Author

/run-unit-test

@lance6716
Copy link
Contributor Author

/run-mysql-test

@lance6716
Copy link
Contributor Author

/merge

@lance6716
Copy link
Contributor Author

/merge

@hawkingrei
Copy link
Member

/merge

@lance6716
Copy link
Contributor Author

/run-build

@hawkingrei
Copy link
Member

/run-check_dev_2

4 similar comments
@lance6716
Copy link
Contributor Author

/run-check_dev_2

@lance6716
Copy link
Contributor Author

/run-check_dev_2

@lance6716
Copy link
Contributor Author

/run-check_dev_2

@purelind
Copy link
Contributor

purelind commented Dec 1, 2022

/run-check_dev_2

@ti-chi-bot
Copy link
Member

@lance6716: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

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 ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot merged commit 78011c5 into pingcap:master Dec 1, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Dec 1, 2022

TiDB MergeCI notify

🔴 Bad News! New failing [1] after this pr merged.
These new failed integration tests seem to be caused by the current PR, please try to fix these new failed integration tests, thanks!

CI Name Result Duration Compare with Parent commit
idc-jenkins-ci-tidb/sqllogic-test-1 🟥 failed 1, success 25, total 26 4 min 8 sec New failing
idc-jenkins-ci/integration-cdc-test 🔴 failed 1, success 39, total 40 26 min Existing failure
idc-jenkins-ci-tidb/integration-common-test 🟢 all 17 tests passed 22 min Existing passed
idc-jenkins-ci-tidb/common-test 🟢 all 11 tests passed 11 min Existing passed
idc-jenkins-ci-tidb/sqllogic-test-2 🟢 all 28 tests passed 6 min 24 sec Existing passed
idc-jenkins-ci-tidb/tics-test 🟢 all 1 tests passed 5 min 55 sec Existing passed
idc-jenkins-ci-tidb/integration-ddl-test 🟢 all 6 tests passed 5 min 19 sec Existing passed
idc-jenkins-ci-tidb/mybatis-test 🟢 all 1 tests passed 3 min 50 sec Existing passed
idc-jenkins-ci-tidb/integration-compatibility-test 🟢 all 1 tests passed 2 min 53 sec Existing passed
idc-jenkins-ci-tidb/plugin-test 🟢 build success, plugin test success 4min Existing passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/lightning This issue is related to Lightning of TiDB. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants