mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Don't remove from cache if it wasn't added during rollback
This commit is contained in:
parent
2416ddfae7
commit
21cdb9a500
@ -463,18 +463,22 @@ void KeeperStorage::UncommittedState::rollback(int64_t rollback_zxid)
|
||||
delta_it->operation);
|
||||
|
||||
auto & path_deltas = deltas_for_path.at(delta_it->path);
|
||||
assert(path_deltas.back() == &*delta_it);
|
||||
path_deltas.pop_back();
|
||||
if (path_deltas.empty())
|
||||
deltas_for_path.erase(delta_it->path);
|
||||
if (path_deltas.back() == &*delta_it)
|
||||
{
|
||||
path_deltas.pop_back();
|
||||
if (path_deltas.empty())
|
||||
deltas_for_path.erase(delta_it->path);
|
||||
}
|
||||
}
|
||||
else if (auto * add_auth = std::get_if<AddAuthDelta>(&delta_it->operation))
|
||||
{
|
||||
auto & uncommitted_auth = session_and_auth[add_auth->session_id];
|
||||
assert(uncommitted_auth.back() == &add_auth->auth_id);
|
||||
uncommitted_auth.pop_back();
|
||||
if (uncommitted_auth.empty())
|
||||
session_and_auth.erase(add_auth->session_id);
|
||||
if (uncommitted_auth.back() == &add_auth->auth_id)
|
||||
{
|
||||
uncommitted_auth.pop_back();
|
||||
if (uncommitted_auth.empty())
|
||||
session_and_auth.erase(add_auth->session_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -263,7 +263,7 @@ public:
|
||||
|
||||
std::shared_ptr<Node> tryGetNodeFromStorage(StringRef path) const;
|
||||
|
||||
std::unordered_map<int64_t, std::list<const AuthID * >> session_and_auth;
|
||||
std::unordered_map<int64_t, std::list<const AuthID *>> session_and_auth;
|
||||
|
||||
struct UncommittedNode
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user