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: update position and status as soon as possible #481

Merged
merged 26 commits into from
May 9, 2020

Conversation

bobotu
Copy link

@bobotu bobotu commented Apr 23, 2020

What problem does this PR solve?

Resolve #468.

What is changed and how it works?

For processor do a tiny refactor to wakeup it when the resolved ts or status have changed.

For owner it is hard to refactor the main loop, so I just add a side-channel to process an updated position as soon as possible.

We can improve the efficiency of the current event model in some harder ways, such as reduce the etcd queries, do less work in the event loop, redesign the whole interaction model, etc. But these ways will change a lot of code and introduce new bugs.

For now, it is safer to do some little changes like this PR to gain some performance improvements in some scenarios.

Check List

Simple benchmark pingcap/ticdc#481 (comment)

Release note

  • update position and status as soon as possible to reduce replication latency

Tests

  • Unit test
  • Integration test

@bobotu
Copy link
Author

bobotu commented Apr 23, 2020

/run-integration-tests

1 similar comment
@bobotu
Copy link
Author

bobotu commented Apr 23, 2020

/run-integration-tests

@bobotu bobotu force-pushed the refactor-worker-and-owner branch from 8aa6a41 to ad00ac5 Compare April 23, 2020 10:10
@bobotu
Copy link
Author

bobotu commented Apr 23, 2020

/run-integration-tests

@bobotu bobotu force-pushed the refactor-worker-and-owner branch from 2f1348c to b8eeb2e Compare April 23, 2020 16:57
@bobotu
Copy link
Author

bobotu commented Apr 23, 2020

/run-integration-tests

@bobotu bobotu force-pushed the refactor-worker-and-owner branch from b8eeb2e to 9219358 Compare April 24, 2020 02:59
@bobotu
Copy link
Author

bobotu commented Apr 24, 2020

/run-integration-tests

@bobotu bobotu force-pushed the refactor-worker-and-owner branch from 9219358 to e94a27e Compare April 24, 2020 03:10
@bobotu bobotu changed the title [WIP] *: reduce ts update latency [WIP] cdc: update position and status as soon as possible Apr 24, 2020
@bobotu
Copy link
Author

bobotu commented Apr 24, 2020

/run-integration-tests

@bobotu bobotu added the subject/performance Denotes an issue or pull request is related to replication performance. label Apr 24, 2020
@bobotu
Copy link
Author

bobotu commented Apr 24, 2020

/run-integration-tests

@bobotu bobotu force-pushed the refactor-worker-and-owner branch from 2237237 to 40fd98f Compare April 24, 2020 04:40
@bobotu
Copy link
Author

bobotu commented Apr 24, 2020

/run-integration-tests

3 similar comments
@bobotu
Copy link
Author

bobotu commented Apr 24, 2020

/run-integration-tests

@bobotu
Copy link
Author

bobotu commented Apr 24, 2020

/run-integration-tests

@bobotu
Copy link
Author

bobotu commented Apr 24, 2020

/run-integration-tests

@bobotu bobotu force-pushed the refactor-worker-and-owner branch from c8163cc to 0449660 Compare April 24, 2020 07:13
@bobotu
Copy link
Author

bobotu commented Apr 24, 2020

/run-integration-tests

@bobotu bobotu force-pushed the refactor-worker-and-owner branch from 0449660 to 1ccbf9e Compare April 24, 2020 07:35
@bobotu
Copy link
Author

bobotu commented Apr 24, 2020

/run-integration-tests

@bobotu bobotu force-pushed the refactor-worker-and-owner branch from 1ccbf9e to 978b1dc Compare April 24, 2020 08:37
@bobotu
Copy link
Author

bobotu commented Apr 24, 2020

/run-integration-tests

1 similar comment
@bobotu
Copy link
Author

bobotu commented Apr 24, 2020

/run-integration-tests

@codecov-io
Copy link

codecov-io commented Apr 24, 2020

Codecov Report

Merging #481 into master will decrease coverage by 0.3656%.
The diff coverage is 1.1834%.

@@               Coverage Diff                @@
##             master       #481        +/-   ##
================================================
- Coverage   31.4302%   31.0645%   -0.3657%     
================================================
  Files            70         70                
  Lines          6831       6876        +45     
================================================
- Hits           2147       2136        -11     
- Misses         4525       4580        +55     
- Partials        159        160         +1     

@bobotu bobotu changed the title [WIP] cdc: update position and status as soon as possible cdc: update position and status as soon as possible Apr 24, 2020
@bobotu bobotu marked this pull request as ready for review April 24, 2020 09:49
@bobotu bobotu force-pushed the refactor-worker-and-owner branch from 5c1150b to eab6cd8 Compare April 26, 2020 04:11
@zier-one
Copy link
Contributor

zier-one commented May 8, 2020

/run-integration-tests

@zier-one
Copy link
Contributor

zier-one commented May 8, 2020

/run-kafka-tests

…d-owner

# Conflicts:
#	cdc/changefeed.go
#	cdc/processor.go
@zier-one
Copy link
Contributor

zier-one commented May 8, 2020

/run-integration-tests

…d-owner

# Conflicts:
#	cdc/changefeed.go
#	cdc/processor.go
@zier-one
Copy link
Contributor

zier-one commented May 8, 2020

/run-integration-tests

@zier-one
Copy link
Contributor

zier-one commented May 9, 2020

/run-integration-tests

@zier-one
Copy link
Contributor

zier-one commented May 9, 2020

/run-integration-tests

@zier-one
Copy link
Contributor

zier-one commented May 9, 2020

/run-integration-tests

1 similar comment
@zier-one
Copy link
Contributor

zier-one commented May 9, 2020

/run-integration-tests

@zier-one
Copy link
Contributor

zier-one commented May 9, 2020

/run-integration-tests

@zier-one
Copy link
Contributor

zier-one commented May 9, 2020

/run-all-tests

leoppro added 2 commits May 9, 2020 14:44
Copy link
Contributor

@amyangfei amyangfei left a comment

Choose a reason for hiding this comment

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

LGTM

@amyangfei amyangfei added component/replica-model Replication model component. LGT1 priority/P0 The issue has P0 priority. labels May 9, 2020
@zier-one
Copy link
Contributor

zier-one commented May 9, 2020

/run-all-tests

@zier-one zier-one merged commit b2bc3dd into pingcap:master May 9, 2020
overvenus pushed a commit to overvenus/ticdc that referenced this pull request May 9, 2020
5kbpers pushed a commit to 5kbpers/ticdc that referenced this pull request Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/replica-model Replication model component. priority/P0 The issue has P0 priority. subject/performance Denotes an issue or pull request is related to replication performance.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimize replication model to decrease replication latency
6 participants