Merge pull request #32988 from JackyWoo/keeper_handler_remove_operation_when_response_sent

keeper handler should remove operation when response sent
This commit is contained in:
alesapin 2021-12-21 17:25:40 +03:00 committed by GitHub
commit 084a1b5ac2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -557,6 +557,8 @@ void KeeperTCPHandler::updateStats(Coordination::ZooKeeperResponsePtr & response
std::lock_guard lock(conn_stats_mutex);
conn_stats.updateLatency(elapsed);
}
operations.erase(response->xid);
keeper_dispatcher->updateKeeperStatLatency(elapsed);
last_op.set(std::make_unique<LastOp>(LastOp{

View File

@ -93,7 +93,7 @@ private:
Poco::Timestamp established;
using Operations = std::map<Coordination::XID, Poco::Timestamp>;
using Operations = std::unordered_map<Coordination::XID, Poco::Timestamp>;
Operations operations;
LastOpMultiVersion last_op;