tables: force to lock the touched index in DML when DDL merging temp index#62387
Conversation
4761250 to
444606e
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #62387 +/- ##
================================================
+ Coverage 72.9000% 73.4431% +0.5431%
================================================
Files 1754 1755 +1
Lines 484967 488074 +3107
================================================
+ Hits 353541 358457 +4916
+ Misses 109800 107982 -1818
- Partials 21626 21635 +9
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
| // to make sure the serialization between the DDL and DML transactions. | ||
| func (c *index) mayDDLMergingTempIndex() bool { | ||
| return c.idxInfo.BackfillState == model.BackfillStateReadyToMerge || | ||
| c.idxInfo.BackfillState == model.BackfillStateMerging |
There was a problem hiding this comment.
@tangenta Please to review this method. It means when ddl worker enters the state BackfillStateReadyToMerge , all the DML should have seen the BackfillStateReadyToMerge or the previous state
There was a problem hiding this comment.
@lcwangchao Better to add comments about the constraint ensured by DDL or the MDL mechanism
|
/retest |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: D3Hunter, tangenta The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Co-authored-by: D3Hunter <jujj603@gmail.com>
|
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
|
In response to a cherrypick label: new pull request created to branch |
|
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
…ng temp index (pingcap#62387)" This reverts commit 95b5aa9.
…ng temp index (pingcap#62387)" This reverts commit 95b5aa9.
…DL merging temp index (pingcap#62387)"" This reverts commit 41508e4.
…ng temp index (pingcap#62387)" This reverts commit 95b5aa9.
…DL merging temp index (pingcap#62387)"" This reverts commit 41508e4.
What problem does this PR solve?
Issue Number: close #62337
Problem Summary:
see descriptions in issue. We choose the second way to fix it.
What changed and how does it work?
When the index is in state
BackfillStateReadyToMergeorBackfillStateMerging, we also lock the touched non-unique indices to ensure the correctness, even if the DDL does not lock the row.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.