pingcap / tidb

TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://www.pingcap.com/tidb-serverless/
https://pingcap.com
Apache License 2.0
36.32k stars 5.72k forks source link

*: check delete unique key's handle to handle corner case (#52975) #53333

Closed ti-chi-bot closed 2 weeks ago

ti-chi-bot commented 2 weeks ago

This is an automated cherry-pick of #52975

What problem does this PR solve?

Issue Number: close #52914

Problem Summary: Take the case from the issue, if an insert is executed during delete only, there is no record on the temporary index. Before the merge process, a delete operation may delete the index key value(generated by ingest) unexpectedly. To avoid this problem, we need to check if the delete value's handle is the same as we want to delete. If not, it means that the value we want to delete is covered by another value already, which shouldn't be deleted again.

What changed and how does it work?

Check List

Tests

Side effects

Documentation

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

fix a bug which may cause data consistency problem when adding unique index 
codecov[bot] commented 2 weeks ago

Codecov Report

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

Please upload report for BASE (release-8.1@e40b817). Learn more about missing BASE report.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## release-8.1 #53333 +/- ## ================================================ Coverage ? 71.1527% ================================================ Files ? 1465 Lines ? 421444 Branches ? 0 ================================================ Hits ? 299869 Misses ? 101101 Partials ? 20474 ``` | [Flag](https://app.codecov.io/gh/pingcap/tidb/pull/53333/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | Coverage Δ | | |---|---|---| | [unit](https://app.codecov.io/gh/pingcap/tidb/pull/53333/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `71.1527% <28.5714%> (?)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap#carryforward-flags-in-the-pull-request-comment) to find out more. | [Components](https://app.codecov.io/gh/pingcap/tidb/pull/53333/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | Coverage Δ | | |---|---|---| | [dumpling](https://app.codecov.io/gh/pingcap/tidb/pull/53333/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `53.9957% <0.0000%> (?)` | | | [parser](https://app.codecov.io/gh/pingcap/tidb/pull/53333/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `∅ <0.0000%> (?)` | | | [br](https://app.codecov.io/gh/pingcap/tidb/pull/53333/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `40.9536% <0.0000%> (?)` | |
jebter commented 2 weeks ago

/retest-required

wjhuang2016 commented 2 weeks ago

/retest

ti-chi-bot[bot] commented 2 weeks ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tangenta, 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: - ~~[OWNERS](https://github.com/pingcap/tidb/blob/release-8.1/OWNERS)~~ [tangenta,wjhuang2016] - ~~[pkg/ddl/OWNERS](https://github.com/pingcap/tidb/blob/release-8.1/pkg/ddl/OWNERS)~~ [tangenta,wjhuang2016] - ~~[pkg/table/OWNERS](https://github.com/pingcap/tidb/blob/release-8.1/pkg/table/OWNERS)~~ [tangenta,wjhuang2016] 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[bot] commented 2 weeks ago

[LGTM Timeline notifier]

Timeline:

jebter commented 2 weeks ago

/retest

jebter commented 2 weeks ago

/retest

jebter commented 2 weeks ago

/retest

wjhuang2016 commented 2 weeks ago

/retest

hawkingrei commented 2 weeks ago

/retest

wjhuang2016 commented 2 weeks ago

/retest