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

Store blob storage ptr in column family handle to avoid mutex #298

Merged
merged 9 commits into from
Jan 3, 2024

Conversation

v01dstar
Copy link
Contributor

Ref #294

Store a shared ptr of BlobStorage in ColumnFamilyHandle, so that, while reading, Titan does not need to lock and fetch it every time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Irrelevant to #294, but need. to be checked in to get my cmake and compiler happy.

CMakeLists.txt Outdated
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Irrelevant to #294, but need. to be checked in to get my cmake and compiler happy.

@@ -355,21 +355,8 @@ TEST_F(TitanDBTest, Open) {
background_job_started = true;
assert(false);
});
SyncPoint::GetInstance()->SetCallBack(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test case does not have any special meaning, I guess. The new change breaks this, because by the time "BeforeOpenBlobFileSet", default_cf_handle_ is not ready yet. We have other means to fix it, but the most graceful way is to remove it.

Copy link
Member

Choose a reason for hiding this comment

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

checked_before_blob_file_set is unused now, please remove it

@@ -139,7 +139,7 @@ class CheckpointTest : public testing::Test {

void Close() {
for (auto h : handles_) {
delete h;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This does not follow the API protocol. And the new change breaks these tests due to the complicity of handling default_cf_handle_'s lifetime.

@v01dstar
Copy link
Contributor Author

Need to merge tikv/rocksdb#353 in advance.

Signed-off-by: Yang Zhang <[email protected]>
src/db_impl.cc Outdated Show resolved Hide resolved
src/db_impl.cc Outdated Show resolved Hide resolved
src/db_impl.h Outdated Show resolved Hide resolved
@v01dstar v01dstar force-pushed the mutex-optimization branch from aec5d29 to f66ad99 Compare January 3, 2024 06:46
Copy link
Member

@Connor1996 Connor1996 left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Yang Zhang <[email protected]>
@v01dstar v01dstar force-pushed the mutex-optimization branch from 952bfae to 842ec98 Compare January 3, 2024 08:21
@Connor1996 Connor1996 changed the title Mutex optimization Store blob storage ptr in column family handle to avoid mutex Jan 3, 2024
@Connor1996 Connor1996 merged commit 50568ef into tikv:master Jan 3, 2024
1 of 2 checks passed
@v01dstar v01dstar deleted the mutex-optimization branch January 3, 2024 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants