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

cdc: drain waits for owner resign and table move out #6110

Merged
merged 4 commits into from
Jun 30, 2022

Conversation

overvenus
Copy link
Member

What problem does this PR solve?

Issue Number: ref #4757

What is changed and how it works?

Drain TiCDC ownership and tables before shutdown.

Tests show there is no (or little) latency when a TiCDC shutdown.

Check List

Tests

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

Run sysbench

# Upstream workload.
sysbench --db-driver=mysql --mysql-host=172.16.5.33 --mysql-port=48104 --mysql-user=root --create_secondary=off \
    --mysql-db=testtable1k --tables=1000 --table-size=1000000 --time=100000000 --threads=5 oltp_update_non_index run

# stop TiCDC manually
$ date && systemctl stop cdc-47915 && date
Tue Jun 28 20:48:32 CST 2022
Tue Jun 28 20:49:31 CST 2022

image

Questions

Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jun 28, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • 3AceShowHand
  • sdojjy

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.

@ti-chi-bot ti-chi-bot added 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. labels Jun 28, 2022
@overvenus overvenus added component/scheduler TiCDC inner scheduler component. area/ticdc Issues or PRs related to TiCDC. tide/merge-method-rebase Denotes a PR that should be rebased by tide when it merges. labels Jun 28, 2022
@codecov-commenter
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (fb/latency@bb1d0d0). Click here to learn what that means.
The diff coverage is n/a.

Flag Coverage Δ
cdc 63.2386% <0.0000%> (?)
dm 51.9483% <0.0000%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

@@               Coverage Diff               @@
##             fb/latency      #6110   +/-   ##
===============================================
  Coverage              ?   57.0819%           
===============================================
  Files                 ?        541           
  Lines                 ?      72240           
  Branches              ?          0           
===============================================
  Hits                  ?      41236           
  Misses                ?      27205           
  Partials              ?       3799           

@ti-chi-bot
Copy link
Member

@hicqu: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

done := make(chan struct{})
close(done)
go func() {
defer close(done)
Copy link
Contributor

Choose a reason for hiding this comment

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

how about groups 2 defer together

@@ -76,7 +89,14 @@ func (d *drainCaptureScheduler) Schedule(
defer d.mu.Unlock()

if d.target == captureIDNotDraining {
return nil
stopping := checkStoppingCapture(captures)
Copy link
Contributor

Choose a reason for hiding this comment

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

how about add a comment to make others know that target can be set by signal.

@3AceShowHand
Copy link
Contributor

rest LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 30, 2022
@overvenus overvenus force-pushed the fb/latency-drain-owner branch from cc17691 to c21b7fa Compare June 30, 2022 04:45
@overvenus
Copy link
Member Author

/run-all-tests

@ti-chi-bot ti-chi-bot removed the status/LGT1 Indicates that a PR has LGTM 1. label Jun 30, 2022
@ti-chi-bot ti-chi-bot added the status/LGT2 Indicates that a PR has LGTM 2. label Jun 30, 2022
@overvenus
Copy link
Member Author

/run-all-tests

@overvenus overvenus force-pushed the fb/latency-drain-owner branch from fa39335 to e859b10 Compare June 30, 2022 06:15
@overvenus
Copy link
Member Author

/run-all-tests

@overvenus overvenus force-pushed the fb/latency-drain-owner branch from e859b10 to 30bd15d Compare June 30, 2022 07:16
@overvenus overvenus merged commit 6252b8c into pingcap:fb/latency Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ticdc Issues or PRs related to TiCDC. component/scheduler TiCDC inner scheduler component. 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/LGT2 Indicates that a PR has LGTM 2. tide/merge-method-rebase Denotes a PR that should be rebased by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants