mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-17 20:02:05 +00:00
Fix build
This commit is contained in:
parent
60b22aaac8
commit
ed34844d02
@ -405,6 +405,24 @@ struct KeeperStorageGetRequest final : public KeeperStorageRequest
|
||||
}
|
||||
};
|
||||
|
||||
namespace
|
||||
{
|
||||
/// Garbage required to apply log to "fuzzy" zookeeper snapshot
|
||||
void updateParentPzxid(const std::string & child_path, int64_t zxid, KeeperStorage::Container & container)
|
||||
{
|
||||
auto parent_path = parentPath(child_path);
|
||||
auto parent_it = container.find(parent_path);
|
||||
if (parent_it != container.end())
|
||||
{
|
||||
container.updateValue(parent_path, [zxid](KeeperStorage::Node & parent)
|
||||
{
|
||||
if (parent.stat.pzxid < zxid)
|
||||
parent.stat.pzxid = zxid;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct KeeperStorageRemoveRequest final : public KeeperStorageRequest
|
||||
{
|
||||
bool checkAuth(KeeperStorage & storage, int64_t session_id) const override
|
||||
@ -422,21 +440,6 @@ struct KeeperStorageRemoveRequest final : public KeeperStorageRequest
|
||||
return checkACL(Coordination::ACL::Delete, node_acls, session_auths);
|
||||
}
|
||||
|
||||
/// Garbage required to apply log to "fuzzy" zookeeper snapshot
|
||||
void updateParentPzxid(const std::string & child_path, int64_t zxid, KeeperStorage::Container & container) const
|
||||
{
|
||||
auto parent_path = parentPath(child_path);
|
||||
auto parent_it = container.find(parent_path);
|
||||
if (parent_it != container.end())
|
||||
{
|
||||
container.updateValue(parent_path, [zxid](KeeperStorage::Node & parent)
|
||||
{
|
||||
if (parent.stat.pzxid < zxid)
|
||||
parent.stat.pzxid = zxid;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
using KeeperStorageRequest::KeeperStorageRequest;
|
||||
std::pair<Coordination::ZooKeeperResponsePtr, Undo> process(KeeperStorage & storage, int64_t zxid, int64_t /*session_id*/) const override
|
||||
{
|
||||
|
@ -181,7 +181,7 @@ void deserializeKeeperStorageFromSnapshot(KeeperStorage & storage, const std::st
|
||||
/// We have incorrect state of storage where some random log entries from future were applied....
|
||||
///
|
||||
/// In ZooKeeper they say that their transactions log is idempotent and can be applied to "fuzzy" state as is.
|
||||
/// It's true but there is no any general invariant which produces this property. They just have banch of ad-hoc "if" which detects
|
||||
/// It's true but there is no any general invariant which produces this property. They just have ad-hoc "if's" which detects
|
||||
/// "fuzzy" state inconsistencies and apply log records in special way. Several examples:
|
||||
/// https://github.com/apache/zookeeper/blob/master/zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java#L453-L463
|
||||
/// https://github.com/apache/zookeeper/blob/master/zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java#L476-L480
|
||||
|
Loading…
Reference in New Issue
Block a user