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

raftstore-v2: support column family based write buffer manager #15453

Merged
merged 9 commits into from
Aug 29, 2023

Conversation

SpadeA-Tang
Copy link
Member

@SpadeA-Tang SpadeA-Tang commented Aug 28, 2023

What is changed and how it works?

Issue Number: Ref #12842

What's Changed:

support column family based write buffer manager

This PR (include related PRs) enables cf based write buffer manager, so that we can use a
separate write buffer manager to mange lock cf.
Compared with default and write cfs, lock cf normally uses and should use significantly less memory, and making all cfs
use a single write buffer manager actually means lock cf has no limit.
Sometimes especially when there's heavy coprocessor requests with insert request, we wish lock cf memtable flushes and compactions timely to make tombstone be removed quickly which can be done by using a relatively small lock write buffer limit after this PR. YCSB workload e demonstrates good for this senario:

ycsb workload e comparison:

qps increases around 15.2%. Both p99 latency and tombstone met reduced a lot.
metrics listed below:

master:

command per second
image
coprocessor p99 duration
image
tombstone
image

this PR

command per second
image
coprocessor p99 duration
image
tombstone
image

Related changes

tikv/rust-rocksdb#763
tikv/rocksdb#343

Check List

Tests

  • Unit test
  • Integration test

Release note

None

Signed-off-by: SpadeA-Tang <[email protected]>
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Aug 28, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • tabokie
  • tonyxuqqi

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 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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 28, 2023
@ti-chi-bot ti-chi-bot bot added needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/needs-linked-issue release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Aug 29, 2023
Signed-off-by: SpadeA-Tang <[email protected]>
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 29, 2023
Signed-off-by: SpadeA-Tang <[email protected]>
src/config/mod.rs Outdated Show resolved Hide resolved
@@ -1330,6 +1336,7 @@ impl Default for DbConfig {
enable_unordered_write: false,
allow_concurrent_memtable_write: None,
write_buffer_limit: None,
lock_write_buffer_limit: None,
Copy link
Member

Choose a reason for hiding this comment

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

Putting it in CfConfig makes more sense.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Signed-off-by: SpadeA-Tang <[email protected]>
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 29, 2023
|| self.defaultcf.write_buffer_limit.is_some()
|| self.raftcf.write_buffer_limit.is_some()
{
return Err(
Copy link
Member

Choose a reason for hiding this comment

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

We can support them all, as long as write_buffer_stall_ratio is 0.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's better to not support now? Expose this when we have use cases and relevant test.

Copy link
Member

Choose a reason for hiding this comment

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

The code is very simple (one modification in build_cf_resources) compared to the benefit. When you forbid a configuration it would be hard to work around it when needed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay,done

Signed-off-by: SpadeA-Tang <[email protected]>
@ti-chi-bot ti-chi-bot bot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 29, 2023
@@ -57,7 +57,8 @@ tracker = { workspace = true }
txn_types = { workspace = true }

[dependencies.rocksdb]
git = "https://github.com/tikv/rust-rocksdb.git"
git = "https://github.com/SpadeA-Tang/rust-rocksdb.git"
Copy link
Contributor

Choose a reason for hiding this comment

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

make sure this is updated.

Copy link
Member Author

Choose a reason for hiding this comment

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

sure

@ti-chi-bot ti-chi-bot bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Aug 29, 2023
Signed-off-by: SpadeA-Tang <[email protected]>
@SpadeA-Tang
Copy link
Member Author

/run-test retry=5

@SpadeA-Tang
Copy link
Member Author

/merge

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Aug 29, 2023

@SpadeA-Tang: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

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.

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Aug 29, 2023

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

Commit hash: f668a00

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 29, 2023
@ti-chi-bot ti-chi-bot bot merged commit 517522b into tikv:master Aug 29, 2023
1 check passed
@ti-chi-bot ti-chi-bot bot added this to the Pool milestone Aug 29, 2023
@ti-chi-bot
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants