Merge pull request #34523 from bigo-sg/nolockappendentries

Keeper no lock on append_entries
This commit is contained in:
Maksim Kita 2022-02-14 21:28:10 +01:00 committed by GitHub
commit db245cfbc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 6 deletions

View File

@ -286,11 +286,8 @@ RaftAppendResult KeeperServer::putRequestBatch(const KeeperStorage::RequestsForS
for (const auto & [session_id, request] : requests_for_sessions)
entries.push_back(getZooKeeperLogEntry(session_id, request));
{
std::lock_guard lock(append_entries_mutex);
return raft_instance->append_entries(entries);
}
}
bool KeeperServer::isLeader() const
{

View File

@ -28,8 +28,6 @@ private:
nuraft::ptr<nuraft::asio_service> asio_service;
nuraft::ptr<nuraft::rpc_listener> asio_listener;
std::mutex append_entries_mutex;
std::mutex initialized_mutex;
std::atomic<bool> initialized_flag = false;
std::condition_variable initialized_cv;