tiflow icon indicating copy to clipboard operation
tiflow copied to clipboard

sourcemanager(ticdc): close all pullers asyncrhonsly to prevent block too long

Open 3AceShowHand opened this issue 1 year ago • 5 comments

What problem does this PR solve?

Issue Number: close #11638

What is changed and how it works?

  • close all pullers asyncronsly

Before this PR, all pullers close in order, one by one, each takes around 0.03 ~ 0.05s, if there are a lot of tables, it would takes a long time.

The following log shows that close 1000 tables takes 50 seconds.

["All pullers have been closed"] [namespace=default] [changefeed=blackhole-test-2] [cost=51.169607168s]

After the PR, the time cost is depend on the slowest table puller, around 0 ~ 2 seconds.

[manager.go:179] ["All pullers have been closed"] [namespace=default] [changefeed=blackhole-test-2] [cost=2.137702035s]

Check List

Tests

  • Unit test
  • Integration test

Questions

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

Release note

fix the puller resource not closed in time

3AceShowHand avatar Oct 17 '24 06:10 3AceShowHand

/retest

3AceShowHand avatar Oct 17 '24 08:10 3AceShowHand

/retest

3AceShowHand avatar Oct 21 '24 04:10 3AceShowHand

/retest

3AceShowHand avatar Oct 21 '24 07:10 3AceShowHand

[LGTM Timeline notifier]

Timeline:

  • 2025-01-22 06:18:42.320436501 +0000 UTC m=+248049.651355902: :ballot_box_with_check: agreed by asddongmen.
  • 2025-01-22 06:20:14.93735494 +0000 UTC m=+248142.268274336: :ballot_box_with_check: agreed by wk989898.

ti-chi-bot[bot] avatar Jan 22 '25 06:01 ti-chi-bot[bot]

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: asddongmen, wk989898

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • ~~OWNERS~~ [asddongmen,wk989898]

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

ti-chi-bot[bot] avatar Jan 22 '25 06:01 ti-chi-bot[bot]