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

Optimsitic: refine optimstic create/drop table #4497

Merged
merged 98 commits into from
Mar 17, 2022

Conversation

GMHDBJD
Copy link
Contributor

@GMHDBJD GMHDBJD commented Jan 27, 2022

What problem does this PR solve?

Issue Number: close #3823

What is changed and how it works?

  • worker flush table info, put source tables when create/drop table
  • master watch source tables and add/remove table for lock

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Code changes

  • Has exported function/method change
  • Has exported variable/fields change
  • Has interface methods change
  • Has persistent data change

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation
  • Need to update key monitor metrics in both TiCDC document and official document

Release note

`None`.

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.

https://github.com/GMHDBJD/ticdc/blob/refineOptimsticCreateTable/dm/dm/master/shardddl/optimist_test.go#L488
Should we remove this function and use the new method in UTs?
Will review later

@GMHDBJD
Copy link
Contributor Author

GMHDBJD commented Mar 16, 2022

/run-all-tests

@GMHDBJD
Copy link
Contributor Author

GMHDBJD commented Mar 17, 2022

cc @lichunzhu

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

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 17, 2022
@GMHDBJD
Copy link
Contributor Author

GMHDBJD commented Mar 17, 2022

/run-all-tests

@GMHDBJD
Copy link
Contributor Author

GMHDBJD commented Mar 17, 2022

/run-all-tests

Copy link
Contributor

@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.

will review later

for routeTable := range droppedTable {
lock := o.lk.FindLock(utils.GenDDLLockID(st.Task, routeTable.DownSchema, routeTable.DownTable))
if lock != nil {
cols := lock.TryRemoveTable(st.Source, routeTable.UpSchema, routeTable.UpTable)
Copy link
Contributor

Choose a reason for hiding this comment

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

if after remove tables the joined table has changed and a DDL should be executed to downstream, how do we handle it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We cannot handle it. e.g. 2 tables
table1 drop column a
drop table2
Now actually we should drop column a in Downstream, but we can't now.

@GMHDBJD
Copy link
Contributor Author

GMHDBJD commented Mar 17, 2022

/run-all-tests

@GMHDBJD
Copy link
Contributor Author

GMHDBJD commented Mar 17, 2022

/run-verify

@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 Mar 17, 2022
@lance6716
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: efa693d

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 17, 2022
@lance6716
Copy link
Contributor

/run-dm-integration-test

@GMHDBJD
Copy link
Contributor Author

GMHDBJD commented Mar 17, 2022

/run-dm-integration-test
/run-verify

@ti-chi-bot ti-chi-bot merged commit 8bbbf7e into pingcap:master Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dm Issues or PRs related to DM. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ 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.

fatal error: concurrent map read and map write in Optimistic Sharding DDL
5 participants