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

redo(ticdc): use memory backend in writer #8107

Merged
merged 7 commits into from
Mar 2, 2023

Conversation

CharlesCheung96
Copy link
Contributor

@CharlesCheung96 CharlesCheung96 commented Jan 18, 2023

What problem does this PR solve?

Issue Number: close #8086

What is changed and how it works?

  1. Split out MetaManager to manage meta and gc. After this pr, cdc will only perform garbage colletion in owner.
  2. Add and implement redo DDLManager.
  3. Refactor writer interface.
  4. Implemet memoryLogWriter.

Check List

Tests

  • Unit test
  • Integration test
  • test_infra test
    1. use memory backend
      • cdc image: redo_test_master_memory_writer_07a32d
      • tcms execution ID: 1621572
    2. use file backend
      • cdc image: redo_test_master_file_writer_77bd6dd
      • tcms execution ID: 1621573
  • Manual test (add detailed scripts or steps below)
    Run benchmark tests with storage = "file:///tmp/testredo", write 300k events to each of the 20 tables
  1. set 50 nanosecond lag for marshalling operation (from 181k ==> 202k)
goos: linux
goarch: amd64
pkg: [github.com/pingcap/tiflow/cdc/redo](http://github.com/pingcap/tiflow/cdc/redo)
cpu: Intel(R) Xeon(R) Gold 6240 CPU @ 2.60GHz
BenchmarkRedoManagerWaitFlush_memory_50NanoLag
[2023/01/30 15:48:40.485 +08:00] [INFO] [manager.go:528] ["redo manager bgUpdateLog is running"] [namespace=] [changefeed=] [flushIntervalInMs=2000]
[2023/01/30 15:48:40.485 +08:00] [INFO] [encoding_worker.go:168] ["redo log encoding workers started"] [workerNum=16]
[2023/01/30 15:48:40.485 +08:00] [INFO] [file_worker.go:139] ["redo file workers started"] [workerNum=8]
BenchmarkRedoManagerWaitFlush_memory_50NanoLag-16              1        296588198108 ns/op      105787869240 B/op       473722266 allocs/op

goos: linux
goarch: amd64
pkg: [github.com/pingcap/tiflow/cdc/redo](http://github.com/pingcap/tiflow/cdc/redo)
cpu: Intel(R) Xeon(R) Gold 6240 CPU @ 2.60GHz
BenchmarkRedoManagerWaitFlush_file_50NanoLag
[2023/01/30 15:55:35.836 +08:00] [INFO] [manager.go:528] ["redo manager bgUpdateLog is running"] [namespace=] [changefeed=] [flushIntervalInMs=2000]
BenchmarkRedoManagerWaitFlush_file_50NanoLag-16                1        331281670719 ns/op      48071539928 B/op        229195602 allocs/op
  1. set 300 nanosecond lag for marshalling operation (from 129k ==> 205k)
goos: linux
goarch: amd64
pkg: [github.com/pingcap/tiflow/cdc/redo](http://github.com/pingcap/tiflow/cdc/redo)
cpu: Intel(R) Xeon(R) Gold 6240 CPU @ 2.60GHz
BenchmarkRedoManagerWaitFlush_memory_300NanoLag
[2023/01/30 16:43:34.852 +08:00] [INFO] [manager.go:528] ["redo manager bgUpdateLog is running"] [namespace=] [changefeed=] [flushIntervalInMs=2000]
[2023/01/30 16:43:34.852 +08:00] [INFO] [encoding_worker.go:168] ["redo log encoding workers started"] [workerNum=16]
[2023/01/30 16:43:34.852 +08:00] [INFO] [file_worker.go:139] ["redo file workers started"] [workerNum=8]
BenchmarkRedoManagerWaitFlush_memory_300NanoLag-16              1        292145861334 ns/op      95117248024 B/op        441196050 allocs/op

goos: linux
goarch: amd64
pkg: [github.com/pingcap/tiflow/cdc/redo](http://github.com/pingcap/tiflow/cdc/redo)
cpu: Intel(R) Xeon(R) Gold 6240 CPU @ 2.60GHz
BenchmarkRedoManagerWaitFlush_file_300NanoLag
[2023/01/30 16:42:45.791 +08:00] [INFO] [manager.go:528] ["redo manager bgUpdateLog is running"] [namespace=] [changefeed=] [flushIntervalInMs=2000]
BenchmarkRedoManagerWaitFlush_file_300NanoLag-16                1        463626690994 ns/op      47229759264 B/op        208209940 allocs/op

Questions

Do you need to update user documentation, design documentation or monitoring documentation?

Add new config consistent.use-file-backend, which is false by default.

Release note

`Add a memory backend writer to redo log`.

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jan 18, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • asddongmen
  • zhaoxinyu

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 do-not-merge/needs-linked-issue release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jan 18, 2023
@CharlesCheung96 CharlesCheung96 force-pushed the redo_use_memory_backend branch 5 times, most recently from 515dc96 to 7b2dc0c Compare January 20, 2023 15:02
@CharlesCheung96 CharlesCheung96 force-pushed the redo_use_memory_backend branch 3 times, most recently from f973c3f to 54c9c36 Compare January 29, 2023 07:45
@CharlesCheung96 CharlesCheung96 marked this pull request as ready for review January 29, 2023 07:47
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 29, 2023
@CharlesCheung96 CharlesCheung96 force-pushed the redo_use_memory_backend branch from 44c8841 to c4104e0 Compare January 30, 2023 03:09
@ti-chi-bot ti-chi-bot added needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. and removed do-not-merge/needs-linked-issue labels Jan 30, 2023
@CharlesCheung96 CharlesCheung96 force-pushed the redo_use_memory_backend branch from c4104e0 to aca422f Compare January 31, 2023 03:41
@ti-chi-bot ti-chi-bot added the needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. label Jan 31, 2023
@CharlesCheung96 CharlesCheung96 force-pushed the redo_use_memory_backend branch from aca422f to 1378ee1 Compare January 31, 2023 05:46
@CharlesCheung96 CharlesCheung96 force-pushed the redo_use_memory_backend branch from 1378ee1 to ba5a62c Compare January 31, 2023 06:27
cdc/redo/manager_test.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 11, 2023
@CharlesCheung96 CharlesCheung96 added the status/ptal Could you please take a look? label Feb 28, 2023
@CharlesCheung96 CharlesCheung96 force-pushed the redo_use_memory_backend branch from 57c5584 to cfd60d6 Compare March 1, 2023 02:33
@CharlesCheung96 CharlesCheung96 force-pushed the redo_use_memory_backend branch from 9437790 to 3db1433 Compare March 1, 2023 06:52
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. status/can-merge Indicates a PR has been approved by a committer. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 1, 2023
@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Mar 1, 2023
@ti-chi-bot
Copy link
Member

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

Commit hash: 564daaa

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 1, 2023
@pingcap pingcap deleted a comment from ti-chi-bot Mar 2, 2023
@CharlesCheung96
Copy link
Contributor Author

/run-integration-test

@ti-chi-bot ti-chi-bot merged commit bacf081 into pingcap:master Mar 2, 2023
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.5: #8410.

ti-chi-bot pushed a commit to ti-chi-bot/tiflow that referenced this pull request Mar 2, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
CharlesCheung96 added a commit to ti-chi-bot/tiflow that referenced this pull request Mar 2, 2023
CharlesCheung96 added a commit to ti-chi-bot/tiflow that referenced this pull request Mar 2, 2023
CharlesCheung96 added a commit to ti-chi-bot/tiflow that referenced this pull request Mar 3, 2023
CharlesCheung96 added a commit to ti-chi-bot/tiflow that referenced this pull request Mar 6, 2023
CharlesCheung96 added a commit to ti-chi-bot/tiflow that referenced this pull request Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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. status/ptal Could you please take a look?
Projects
None yet
Development

Successfully merging this pull request may close these issues.

duration of writeLog and flushLog in the redo module is too long
6 participants