From 1bf46546188976c71c2b6b8cb911aecc0b85895e Mon Sep 17 00:00:00 2001 From: JaySon Date: Tue, 26 Dec 2023 18:16:57 +0800 Subject: [PATCH] KVStore: Reduce lock contention in `RegionPersister::doPersist` (#8593) close pingcap/tiflash#8583 --- dbms/src/Storages/Transaction/RegionPersister.cpp | 2 -- dbms/src/Storages/Transaction/RegionPersister.h | 1 - 2 files changed, 3 deletions(-) diff --git a/dbms/src/Storages/Transaction/RegionPersister.cpp b/dbms/src/Storages/Transaction/RegionPersister.cpp index ee4056dc297..03312791050 100644 --- a/dbms/src/Storages/Transaction/RegionPersister.cpp +++ b/dbms/src/Storages/Transaction/RegionPersister.cpp @@ -106,8 +106,6 @@ void RegionPersister::doPersist(RegionCacheWriteElement & region_write_buffer, c { auto & [region_id, buffer, region_size, applied_index] = region_write_buffer; - std::lock_guard lock(mutex); - if (page_reader) { auto entry = page_reader->getPageEntry(region_id); diff --git a/dbms/src/Storages/Transaction/RegionPersister.h b/dbms/src/Storages/Transaction/RegionPersister.h index 7cdd36e8e3a..2cb9c7d54d8 100644 --- a/dbms/src/Storages/Transaction/RegionPersister.h +++ b/dbms/src/Storages/Transaction/RegionPersister.h @@ -81,7 +81,6 @@ class RegionPersister final : private boost::noncopyable NamespaceId ns_id = KVSTORE_NAMESPACE_ID; const RegionManager & region_manager; - std::mutex mutex; LoggerPtr log; }; } // namespace DB