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

gc: support multi-rocksdb in compaction filter #13228

Closed
wants to merge 55 commits into from

Conversation

BornChanger
Copy link
Contributor

@BornChanger BornChanger commented Aug 4, 2022

Signed-off-by: BornChanger dawn_catcher@126.com

What is changed and how it works?

Issue Number: Close #13131

What's Changed:

Associate proper region id, suffix id and optional engine factory to WriteCompactionFilterFactory and RawCompactionFilterFactory at cfs option creation time. At create_compaction_filter time, retrieve the proper rocksdb engine instead of db in the global GC_CONTEXT.

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

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

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Aug 4, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • 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.

@BornChanger
Copy link
Contributor Author

/run-test

src/config.rs Outdated Show resolved Hide resolved
@BornChanger
Copy link
Contributor Author

/run-test

@BornChanger
Copy link
Contributor Author

/cc @tabokie

@BornChanger
Copy link
Contributor Author

cc @tabokie

@BornChanger
Copy link
Contributor Author

/run-clippy-linux-arm64

@BornChanger BornChanger requested review from tonyxuqqi and removed request for tabokie August 30, 2022 15:24
@BornChanger
Copy link
Contributor Author

/run-test retry=7

1 similar comment
@BornChanger
Copy link
Contributor Author

/run-test retry=7

components/server/src/server.rs Outdated Show resolved Hide resolved
components/engine_test/src/lib.rs Outdated Show resolved Hide resolved
tests/failpoints/cases/test_gc_worker.rs Outdated Show resolved Hide resolved
let ops = DbOptions::default();
let path = Builder::new()
.prefix("test_gc_keys_with_region_info_provider")
.tempdir()
Copy link
Member

Choose a reason for hiding this comment

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

All the usage of tempdir is incorrect. Because when the Tempdir object goes out of scope, the directory will be automatically deleted, and the engine data will be lost too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What you said is right. I have corrected other occurrence for path construction except for prepare_gc(). At prepare_gc() invocation time, engine is ready (passed as one parameter), so the temp dir dropping is ok. It's just a skeleton for factory construction, while the factory won't really create any rocksdb later and is only for storing the registry of <<region_id, suffix_id>, rocksdb> in GC_Context.

@@ -167,6 +168,7 @@ fn do_gc(
}

#[test]
#[cfg(not(feature = "test-engines-panic"))]
Copy link
Member

Choose a reason for hiding this comment

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

Why not test-engine-kv-rocksdb. The problem with test-engines-panic is, the build will still fail if we uses --features test-engine-kv-panic,test-engine-raft-rocksdb or --features test-engines-another-kind-of-engine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems I can't express that way. When ENABLE_FEATURES is not set by default, config predicate feature=test-engine-kv-rocksdb won't be satisfied either.

Signed-off-by: BornChanger <dawn_catcher@126.com>
Signed-off-by: BornChanger <dawn_catcher@126.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
…ocksdb

Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
…ocksdb

Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
@tabokie tabokie requested a review from BusyJay November 3, 2022 03:52
Signed-off-by: Xinye Tao <xy.tao@outlook.com>
@ti-chi-bot
Copy link
Member

@BornChanger: PR needs rebase.

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 kubernetes/test-infra repository.

@tabokie
Copy link
Member

tabokie commented Mar 1, 2023

Superseded by #13982.

@tabokie tabokie closed this Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution Type: PR - From contributors needs-rebase release-note-none size/XL status/LGT1 Status: PR - There is already 1 approval
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GC with compaction filter support multi tablets
6 participants