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

optimist: only update table info if no conflict #1496

Merged
merged 7 commits into from
Mar 11, 2021

Conversation

GMHDBJD
Copy link
Collaborator

@GMHDBJD GMHDBJD commented Mar 10, 2021

What problem does this PR solve?

close #1484

What is changed and how it works?

If a ddl conflict with previous one, do not update table info in master, so we can use handle-error replace to replace a new ddl and no conflict.

Check List

Tests

  • Unit test
  • Integration test

@GMHDBJD GMHDBJD added status/PTAL This PR is ready for review. Add this label back after committing new changes type/bug-fix Bug fix needs-update-release-note This PR should be added into release notes. Remove this label once the release notes are updated needs-cherry-pick-release-2.0 This PR should be cherry-picked to release-2.0. Remove this label after cherry-picked to release-2.0 labels Mar 10, 2021
@lance6716 lance6716 added this to the v2.0.2 milestone Mar 10, 2021
Copy link
Collaborator

@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

pkg/shardddl/optimism/lock_test.go Show resolved Hide resolved
@lance6716
Copy link
Collaborator

/lgtm

@ti-srebot ti-srebot added the status/LGT1 One reviewer already commented LGTM label Mar 11, 2021
Copy link
Contributor

@lichunzhu lichunzhu left a comment

Choose a reason for hiding this comment

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

LGTM

@lichunzhu
Copy link
Contributor

/lgtm

@ti-srebot ti-srebot removed the status/LGT1 One reviewer already commented LGTM label Mar 11, 2021
ti-srebot
ti-srebot previously approved these changes Mar 11, 2021
@ti-srebot ti-srebot added the status/LGT2 Two reviewers already commented LGTM, ready for merge label Mar 11, 2021
@lichunzhu
Copy link
Contributor

/merge

@@ -180,8 +185,9 @@ func (l *Lock) TrySync(callerSource, callerSchema, callerTable string,
nextTable = schemacmp.Encode(newTI)
// special case: check whether DDLs making the schema become part of larger and another part of smaller.
if _, err = prevTable.Compare(nextTable); err != nil {
return emptyDDLs, terror.ErrShardDDLOptimismTrySyncFail.Delegate(
err = terror.ErrShardDDLOptimismTrySyncFail.Delegate(
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this? err is a returned variable in L95.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

address in dfab765

@CLAassistant
Copy link

CLAassistant commented Mar 11, 2021

CLA assistant check
All committers have signed the CLA.

@ti-srebot
Copy link

/run-all-tests

@GMHDBJD GMHDBJD merged commit 301dd99 into pingcap:master Mar 11, 2021
@GMHDBJD GMHDBJD deleted the fixHandleConflictDDL branch March 11, 2021 10:17
ti-srebot pushed a commit to ti-srebot/dm that referenced this pull request Mar 11, 2021
@ti-srebot
Copy link

cherry pick to release-2.0 in PR #1502

@ti-srebot ti-srebot added already-cherry-pick-2.0 The related PR is already cherry-picked to release-2.0. Add this label once the PR is cherry-picked and removed needs-cherry-pick-release-2.0 This PR should be cherry-picked to release-2.0. Remove this label after cherry-picked to release-2.0 labels Mar 11, 2021
lance6716 pushed a commit that referenced this pull request Mar 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
already-cherry-pick-2.0 The related PR is already cherry-picked to release-2.0. Add this label once the PR is cherry-picked needs-update-release-note This PR should be added into release notes. Remove this label once the release notes are updated status/can-merge status/LGT2 Two reviewers already commented LGTM, ready for merge status/PTAL This PR is ready for review. Add this label back after committing new changes type/bug-fix Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

handle-error replace can't handle default value conflict in optimistic mode.
5 participants