Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

shardddl: fix resume conflict ddl. #722

Merged
merged 15 commits into from
Jun 15, 2020

Conversation

GMHDBJD
Copy link
Collaborator

@GMHDBJD GMHDBJD commented Jun 8, 2020

What problem does this PR solve?

#719 #582

What is changed and how it works?

  • reset shardmeta after start or resume task
  • mark ErrSyncerShardDDLConflict as UnresumableError

Tests

  • Unit test
  • Integration test

Related changes

  • Need to cherry-pick to the release branch

@GMHDBJD GMHDBJD added priority/normal Minor change, requires approval from ≥1 primary reviewer status/PTAL This PR is ready for review. Add this label back after committing new changes labels Jun 8, 2020
@codecov
Copy link

codecov bot commented Jun 8, 2020

Codecov Report

Merging #722 into master will decrease coverage by 0.0733%.
The diff coverage is 56.7567%.

@@               Coverage Diff                @@
##             master       #722        +/-   ##
================================================
- Coverage   57.0981%   57.0248%   -0.0734%     
================================================
  Files           205        205                
  Lines         21104      21189        +85     
================================================
+ Hits          12050      12083        +33     
- Misses         7890       7931        +41     
- Partials       1164       1175        +11     

@@ -178,25 +178,23 @@ func (meta *ShardingMeta) checkItemExists(item *DDLItem) (int, bool) {
// active: whether the DDL will be processed in this round
func (meta *ShardingMeta) AddItem(item *DDLItem) (active bool, err error) {
index, exists := meta.checkItemExists(item)
if exists {
return index == meta.activeIdx, nil
Copy link
Member

@csuzhangxc csuzhangxc Jun 8, 2020

Choose a reason for hiding this comment

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

Is it easy to add a negative test case for #719?

one more question, can we reset shard meta when resuming?

@GMHDBJD GMHDBJD added the needs-cherry-pick-release-1.0 This PR should be cherry-picked to release-1.0. Remove this label after cherry-picked to release-1.0 label Jun 10, 2020
@GMHDBJD
Copy link
Collaborator Author

GMHDBJD commented Jun 11, 2020

/run-all-tests

@csuzhangxc csuzhangxc added this to the v1.0.6 milestone Jun 15, 2020
Copy link
Contributor

@WangXiangUSTC WangXiangUSTC 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, and which modify related to the description check ddl conflict even the ddl exist?

"\"result\": true" 3

cp $cur/conf/dm-task.yaml $WORK_DIR/task.yaml
echo "ignore-checking-items: [\"all\"]" >> $WORK_DIR/task.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

why need to ignore all checks? how about adding a comment

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

add comment in 644a504

@GMHDBJD
Copy link
Collaborator Author

GMHDBJD commented Jun 15, 2020

rest LGTM, and which modify related to the description check ddl conflict even the ddl exist?

We have a discuss in #582 (comment) .
Now we reset the shardmeta when resume and it will check conflict again. The description check ddl conflict even the ddl exist is outdated now, I will update it.

Copy link
Member

@csuzhangxc csuzhangxc left a comment

Choose a reason for hiding this comment

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

LGTM

@csuzhangxc csuzhangxc added status/LGT1 One reviewer already commented LGTM and removed status/PTAL This PR is ready for review. Add this label back after committing new changes labels Jun 15, 2020
Copy link
Contributor

@WangXiangUSTC WangXiangUSTC left a comment

Choose a reason for hiding this comment

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

LGTM

@WangXiangUSTC WangXiangUSTC added status/LGT2 Two reviewers already commented LGTM, ready for merge and removed status/LGT1 One reviewer already commented LGTM labels Jun 15, 2020
@csuzhangxc csuzhangxc merged commit 487dc85 into pingcap:master Jun 15, 2020
@ti-srebot
Copy link

cherry pick to release-1.0 failed

@csuzhangxc
Copy link
Member

@GMHDBJD please cherry-pick it manually again. 😢

GMHDBJD added a commit to GMHDBJD/dm that referenced this pull request Jun 15, 2020
@csuzhangxc csuzhangxc added already-cherry-pick-1.0 The related PR is already cherry-picked to release-1.0. Add this label once the PR is cherry-picked and removed needs-cherry-pick-release-1.0 This PR should be cherry-picked to release-1.0. Remove this label after cherry-picked to release-1.0 labels Jun 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
already-cherry-pick-1.0 The related PR is already cherry-picked to release-1.0. Add this label once the PR is cherry-picked priority/normal Minor change, requires approval from ≥1 primary reviewer status/LGT2 Two reviewers already commented LGTM, ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants