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

fix sync-ddl control #1130

Merged
merged 2 commits into from
Jan 19, 2022
Merged

fix sync-ddl control #1130

merged 2 commits into from
Jan 19, 2022

Conversation

cartersz
Copy link
Contributor

What problem does this PR solve?

Issue Number: ref #1129

What is changed and how it works?

add SyncDDL switcher to the process that is whether drainer server should stop when non 'truncate table **' statement sync to drainer.

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 the tidb-ansible repository
  • Need to be included in the release note

Release note

  • No release note

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jan 17, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • glorv
  • lichunzhu

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@cartersz
Copy link
Contributor Author

/run-all-tests

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

@@ -492,7 +492,7 @@ ForLoop:
continue
}
} else if !ignore && s.cfg.DestDBType == "oracle" {
if _, ok := stmt.(*ast.TruncateTableStmt); !ok {
if _, ok := stmt.(*ast.TruncateTableStmt); !ok && s.cfg.SyncDDL {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a bit confuse why we only check s.cfg.SyncDDL in such inner block. Is it bettern to check and skip all DDL event at L433. @lichunzhu

Copy link
Contributor

Choose a reason for hiding this comment

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

Because we don't continue here but just set shouldSkip = true to make sure this table's schema can be updated in time. Maybe we should return an error in oracle dsyncer's loader, but I think return an error here is also okay.

Copy link
Contributor

@glorv glorv Jan 18, 2022

Choose a reason for hiding this comment

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

I mean we should move !s.cfg.SyncDDL to L433 instead of check here.

Copy link
Contributor

@lichunzhu lichunzhu Jan 18, 2022

Choose a reason for hiding this comment

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

SGTM, but we need to sync this item at L433 too. @cartersz

@ti-chi-bot ti-chi-bot added size/M and removed size/XS labels Jan 19, 2022
@glorv
Copy link
Contributor

glorv commented Jan 19, 2022

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 97655ca

@lichunzhu
Copy link
Contributor

/run-all-tests

@ti-chi-bot ti-chi-bot merged commit 4246eae into pingcap:master Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants