mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 21:51:57 +00:00
Add ephemerals on preprocess
This commit is contained in:
parent
d8c247cfdc
commit
f379f225fa
@ -421,7 +421,6 @@ Coordination::Error KeeperStorage::commit(int64_t commit_zxid, int64_t session_i
|
||||
std::move(operation.data),
|
||||
operation.stat,
|
||||
operation.is_sequental,
|
||||
operation.is_ephemeral,
|
||||
std::move(operation.acls),
|
||||
session_id))
|
||||
onStorageInconsistency();
|
||||
@ -503,9 +502,8 @@ bool KeeperStorage::createNode(
|
||||
String data,
|
||||
const Coordination::Stat & stat,
|
||||
bool is_sequental,
|
||||
bool is_ephemeral,
|
||||
Coordination::ACLs node_acls,
|
||||
int64_t session_id)
|
||||
int64_t /*session_id*/)
|
||||
{
|
||||
auto parent_path = parentPath(path);
|
||||
auto node_it = container.find(parent_path);
|
||||
@ -533,9 +531,6 @@ bool KeeperStorage::createNode(
|
||||
auto child_path = getBaseName(map_key->getKey());
|
||||
container.updateValue(parent_path, [child_path](KeeperStorage::Node & parent) { parent.addChild(child_path); });
|
||||
|
||||
if (is_ephemeral)
|
||||
ephemerals[session_id].emplace(path);
|
||||
|
||||
addDigest(map_key->getMapped()->value, map_key->getKey().toView());
|
||||
return true;
|
||||
};
|
||||
@ -740,7 +735,7 @@ struct KeeperStorageCreateRequestProcessor final : public KeeperStorageRequestPr
|
||||
new_deltas.emplace_back(
|
||||
std::move(path_created),
|
||||
zxid,
|
||||
KeeperStorage::CreateNodeDelta{stat, request.is_ephemeral, request.is_sequential, std::move(node_acls), request.data});
|
||||
KeeperStorage::CreateNodeDelta{stat, request.is_sequential, std::move(node_acls), request.data});
|
||||
|
||||
int32_t parent_cversion = request.parent_cversion;
|
||||
|
||||
@ -760,6 +755,9 @@ struct KeeperStorageCreateRequestProcessor final : public KeeperStorageRequestPr
|
||||
++node.stat.numChildren;
|
||||
}});
|
||||
|
||||
if (request.is_ephemeral)
|
||||
storage.ephemerals[session_id].emplace(path_created);
|
||||
|
||||
digest = storage.calculateNodesDigest(digest, new_deltas);
|
||||
return new_deltas;
|
||||
}
|
||||
@ -1776,7 +1774,6 @@ void KeeperStorage::preprocessRequest(
|
||||
}
|
||||
|
||||
new_digest = calculateNodesDigest(new_digest, new_deltas);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -146,7 +146,6 @@ public:
|
||||
struct CreateNodeDelta
|
||||
{
|
||||
Coordination::Stat stat;
|
||||
bool is_ephemeral;
|
||||
bool is_sequental;
|
||||
Coordination::ACLs acls;
|
||||
String data;
|
||||
@ -266,7 +265,6 @@ public:
|
||||
String data,
|
||||
const Coordination::Stat & stat,
|
||||
bool is_sequental,
|
||||
bool is_ephemeral,
|
||||
Coordination::ACLs node_acls,
|
||||
int64_t session_id);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user