8000 Feature/hybrid smart graph by mchacki · Pull Request #14602 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Feature/hybrid smart graph #14602

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 96 commits into from
Sep 10, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
e951cba
Feature/hybrid smart graph api (#14037)
hkernbach Apr 22, 2021
33e7d19
Merge branch 'devel' of github.com:arangodb/arangodb into feature/hyb…
hkernbach Apr 22, 2021
1b4657c
add satellites to GraphNode
hkernbach Apr 22, 2021
a85416c
add satellites to ShardLocking
hkernbach Apr 22, 2021
fec767c
Revert "add satellites to ShardLocking"
hkernbach Apr 22, 2021
5bee2ce
Revert "add satellites to GraphNode"
hkernbach Apr 22, 2021
6893fe8
Merge branch 'devel' of github.com:arangodb/arangodb into feature/hyb…
hkernbach Apr 28, 2021
f9b501e
Merge branch 'devel' of github.com:arangodb/arangodb into feature/hyb…
hkernbach Apr 28, 2021
efc008d
Merge branch 'feature/hybrid-smart-graph' of github.com:arangodb/aran…
hkernbach Apr 28, 2021
e1207cc
Merge branch 'devel' of github.com:arangodb/arangodb into feature/hyb…
hkernbach May 4, 2021
6d79db1
Merge branch 'devel' of github.com:arangodb/arangodb into feature/hyb…
hkernbach May 4, 2021
e814204
Merge branch 'devel' of github.com:arangodb/arangodb into feature/hyb…
hkernbach Jun 1, 2021
8355c20
Merge branch 'devel' of github.com:arangodb/arangodb into feature/hyb…
hkernbach Jun 1, 2021
2d0c7ca
Merge branch 'devel' of github.com:arangodb/arangodb into feature/hyb…
hkernbach Jun 10, 2021
3fab230
Merge branch 'devel' of github.com:arangodb/arangodb into feature/hyb…
hkernbach Jun 14, 2021
517067a
Merge branch 'devel' of github.com:arangodb/arangodb into feature/hyb…
hkernbach Jun 21, 2021
0392473
Feature/hybrid smart graph testsuite (#14056)
hkernbach Jun 30, 2021
6904401
Merge branch 'devel' of github.com:arangodb/arangodb into feature/hyb…
hkernbach Jul 1, 2021
94484e3
renamed evalExpression -> evaluateVertexExpression (#14449)
hkernbach Jul 5, 2021
47bf4bb
fix init of variables (#14442)
hkernbach Jul 5, 2021
0cc1c07
unify method used in cursor readAll - GORDO-1210 (#14443)
hkernbach Jul 5, 2021
71d3495
Feature/hybrid smart graph testsuite extended (#14432)
hkernbach Jul 6, 2021
2eea3de
Merge branch 'devel' of github.com:arangodb/arangodb into feature/hyb…
hkernbach Jul 7, 2021
fa37f39
Feature/hybrid smart graph test setup helper (#14455)
mchacki Jul 7, 2021
087a29c
Feature/hybrid smart graph glue cpp tests (#14485)
mchacki Jul 8, 2021
cea612e
merge origin into feature branch
hkernbach Jul 12, 2021
7751eec
Feature/hybrid smart graph additional steptype (#14474)
hkernbach Jul 12, 2021
bfd7155
Merge branch 'devel' of github.com:arangodb/arangodb into feature/hyb…
hkernbach Jul 12, 2021
a865b05
Merge branch 'devel' of github.com:arangodb/arangodb into feature/hyb…
hkernbach Jul 14, 2021
8b8bf50
Merge remote-tracking branch 'origin/devel' into feature/hybrid-smart…
mchacki Jul 16, 2021
1f6e724
Readded lost merge update
mchacki Jul 16, 2021
839cdc1
Reduced total amount of Nodes per CallStack to 200. For some reason 2…
mchacki Jul 19, 2021
5fe4b14
Make Globale variable overwrite less intrusive for tests
mchacki Jul 19, 2021
d2b6e21
Feature/hybrid smart graph enable bfs (#14494)
hkernbach Jul 19, 2021
724809b
Merge remote-tracking branch 'origin/devel' into feature/hybrid-smart…
hkernbach Jul 19, 2021
9673453
Merge remote-tracking branch 'origin/devel' into feature/hybrid-smart…
mchacki Jul 30, 2021
35c9472
Feature/hybrid smart graph enable weighted (#14560)
mchacki Aug 3, 2021
a81e773
Feature/hybrid smart graph include disjoint (#14578)
mchacki Aug 4, 2021
0063f41
Merge remote-tracking branch 'origin/devel' into feature/hybrid-smart…
hkernbach Aug 6, 2021
0f86657
format, later cursor init (#14588)
hkernbach Aug 6, 2021
1609df4
Merge remote-tracking branch 'origin/devel' into feature/hybrid-smart…
hkernbach Aug 9, 2021
6c16f49
Feature/hybrid smart graph modify graph (#14598)
mchacki Aug 10, 2021
0bf12eb
Feature/hybrid smart graph remove old code 2 (#14600)
mchacki Aug 10, 2021
1ace9dc
Added a test to validate if we are satellite leader (#14619)
mchacki Aug 11, 2021
fdf3fc2
Removed false comment
mchacki Aug 17, 2021
6903a16
Removed unused local struct
mchacki Aug 17, 2021
46df6e5
Moved TraverserShardList to it's own file
mchacki Aug 20, 2021
5da8cd6
Made Method call lower case
mchacki Aug 20, 2021
8d13644
Removed leftover comment
mchacki Aug 20, 2021
5bdc998
Renamed smartSearchNew -> smartSearch. The new was only temporary.
mchacki Aug 20, 2021
b090815
Simplified assertion
mchacki Aug 20, 2021
7ae0ca1
Removed Development comments
mchacki Aug 20, 2021
fdec800
Try to reduce deplicate code
mchacki Aug 20, 2021
159c5d1
Removed TODOs, we actually want to keep the version we have now
mchacki Aug 20, 2021
d7b40bd
Removed incorrect TODOs
mchacki Aug 20, 2021
cdd8899
Removed double exclude of enterprise version.
mchacki Aug 20, 2021
9240c2f
Worked on leftover todos
mchacki Aug 20, 2021
f6a876e
Improved TODO comment to why we cannot change it right now, but would…
mchacki Aug 20, 2021
a89ee57
Removed unused Member
mchacki Aug 20, 2021
e1fe7bb
Removed dead code
mchacki Aug 20, 2021
b74ca22
Removed dead code
mchacki Aug 20, 2021
30776f1
Fixed incude style
mchacki Aug 20, 2021
1dbcc0e
Removed TODO, this is not important, we can replace pair, by struct.
mchacki Aug 20, 2021
48e1791
move method into class, make more methods const
hkernbach Sep 3, 2021
445b6cf
added two new static strings: key post and prefix
hkernbach Sep 6, 2021
51a1afe
more use of static strings
hkernbach Sep 6, 2021
88a7312
throw in case we fail to inject variables
hkernbach Sep 6, 2021
77d1ec1
changed name of a variable to a more descriptive one
hkernbach Sep 7, 2021
38eaeb8
refactored _collectionToShard
hkernbach Sep 7, 2021
1655054
moved declarations as not needed here
hkernbach Sep 7, 2021
0bab447
Update tests/Graph/DFSFinderTest.cpp
hkernbach Sep 7, 2021
8491fb1
Update tests/Graph/DFSFinderTest.cpp
hkernbach Sep 7, 2021
023882f
Update tests/Graph/DFSFinderTest.cpp
hkernbach Sep 7, 2021
6eabbb3
Update tests/Graph/DFSFinderTest.cpp
hkernbach Sep 7, 2021
68c1f53
Update tests/Graph/DFSFinderTest.cpp
hkernbach Sep 7, 2021
c1a38d6
Update tests/Graph/DFSFinderTest.cpp
hkernbach Sep 7, 2021
c9001a2
Update tests/Graph/DFSFinderTest.cpp
hkernbach Sep 7, 2021
18f87ea
Update tests/Graph/DFSFinderTest.cpp
hkernbach Sep 7, 2021
d8e6cb7
Update tests/Graph/DFSFinderTest.cpp
hkernbach Sep 7, 2021
23c11bf
removed unneeded clear
hkernbach Sep 7, 2021
d6febe9
Merge branch 'feature/hybrid-smart-graph' of github.com:arangodb/aran…
hkernbach Sep 7, 2021
ec68f06
Update tests/Graph/DFSFinderTest.cpp
hkernbach Sep 7, 2021
f70445d
Update tests/Graph/DFSFinderTest.cpp
hkernbach Sep 7, 2021
1bf6c3c
Update tests/Graph/DFSFinderTest.cpp
hkernbach Sep 7, 2021
c0d3ebe
Update tests/Graph/DFSFinderTest.cpp
hkernbach Sep 7, 2021
d6f5296
Update tests/Graph/DFSFinderTest.cpp
hkernbach Sep 7, 2021
cf32daa
Update tests/Graph/DFSFinderTest.cpp
hkernbach Sep 7, 2021
83714c7
Update tests/Graph/DFSFinderTest.cpp
hkernbach Sep 7, 2021
c98c94c
ssp test cleanup, disabled expr, added asserts
hkernbach Sep 7, 2021
8aa1d12
Merge branch 'feature/hybrid-smart-graph' of github.com:arangodb/aran…
hkernbach Sep 7, 2021
4044402
Made Expression a unique_ptr, by explicitly deleting copy and allowin…
mchacki Sep 7, 2021
535f7a6
Removed forgotten assert
mchacki Sep 8, 2021
90d995e
fix serializing of GraphNode
hkernbach Sep 8, 2021
0b27968
Merge remote-tracking branch 'origin/devel' into feature/hybrid-smart…
mchacki Sep 8, 2021
acf4c59
Fixed compiler issue
mchacki Sep 8, 2021
08545df
Fixed UnitTest
mchacki Sep 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Feature/hybrid smart graph test setup helper (#14455)
  • Loading branch information
mchacki authored Jul 7, 2021
commit fa37f394eca575444308c230da5936c281fbfa9f
78 changes: 45 additions & 33 deletions arangod/Aql/EngineInfoContainerDBServerServerBased.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
#include "StorageEngine/TransactionState.h"
#include "Utils/CollectionNameResolver.h"

#include <set>
#include <velocypack/Collection.h>
#include <set>

using namespace arangodb;
using namespace arangodb::aql;
Expand Down Expand Up @@ -80,10 +80,13 @@ EngineInfoContainerDBServerServerBased::TraverserEngineShardLists::TraverserEngi
auto const& edges = _node->edgeColls();
TRI_ASSERT(!edges.empty());
auto const& restrictToShards = query.queryOptions().restrictToShards;
#ifdef USE_ENTERPRISE
transaction::Methods trx{query.newTrxContext()};
#endif
// Extract the local shards for edge collections.
for (auto const& col : edges) {
#ifdef USE_ENTERPRISE
if (query.trxForOptimization().isInaccessibleCollection(col->id())) {
if (trx.isInaccessibleCollection(col->id())) {
_inaccessible.insert(col->name());
_inaccessible.insert(std::to_string(col->id().id()));
}
Expand All @@ -100,7 +103,7 @@ EngineInfoContainerDBServerServerBased::TraverserEngineShardLists::TraverserEngi
// Or if we guarantee to never read vertex data.
for (auto const& col : vertices) {
#ifdef USE_ENTERPRISE
if (query.trxForOptimization().isInaccessibleCollection(col->id())) {
if (trx.isInaccessibleCollection(col->id())) {
_inaccessible.insert(col->name());
_inaccessible.insert(std::to_string(col->id().id()));
}
Expand All @@ -112,8 +115,8 @@ EngineInfoContainerDBServerServerBased::TraverserEngineShardLists::TraverserEngi
}

std::vector<ShardID> EngineInfoContainerDBServerServerBased::TraverserEngineShardLists::getAllLocalShards(
std::unordered_map<ShardID, ServerID> const& shardMapping,
ServerID const& server, std::shared_ptr<std::vector<std::string>> shardIds, bool colIsSatellite) {
std::unordered_map<ShardID, ServerID> const& shardMapping, ServerID const& server,
std::shared_ptr<std::vector<std::string>> shardIds, bool colIsSatellite) {
std::vector<ShardID> localShards;
for (auto const& shard : *shardIds) {
auto const& it = shardMapping.find(shard);
Expand Down Expand Up @@ -255,8 +258,7 @@ void EngineInfoContainerDBServerServerBased::closeSnippet(QueryId inputSnippet)
}

std::vector<bool> EngineInfoContainerDBServerServerBased::buildEngineInfo(
QueryId clusterQueryId,
VPackBuilder& infoBuilder, ServerID const& server,
QueryId clusterQueryId, VPackBuilder& infoBuilder, ServerID const& server,
std::unordered_map<ExecutionNodeId, ExecutionNode*> const& nodesById,
std::map<ExecutionNodeId, ExecutionNodeId>& nodeAliases) {
LOG_TOPIC("4bbe6", DEBUG, arangodb::Logger::AQL)
Expand Down Expand Up @@ -322,19 +324,19 @@ arangodb::futures::Future<Result> EngineInfoContainerDBServerServerBased::buildS

auto buildCallback =
[this, server, serverDest, didCreateEngine = std::move(didCreateEngine),
&serverToQueryId, &serverToQueryIdLock, &snippetIds, globalId](
arangodb::futures::Try<arangodb::network::Response> const& response) -> Result {
&serverToQueryId, &serverToQueryIdLock, &snippetIds,
globalId](arangodb::futures::Try<arangodb::network::Response> const& response) -> Result {
auto const& resolvedResponse = response.get();
auto queryId = globalId;

std::unique_lock<std::mutex> guard{serverToQueryIdLock};

if (resolvedResponse.fail()) {
Result res = resolvedResponse.combinedResult();
LOG_TOPIC("f9a77", DEBUG, Logger::AQL)
<< server << " responded with " << res.errorNumber() << ": "
<< res.errorMessage();

serverToQueryId.emplace_back(serverDest, globalId);
return res;
}
Expand All @@ -351,8 +353,8 @@ arangodb::futures::Future<Result> EngineInfoContainerDBServerServerBased::buildS
};

return network::sendRequestRetry(pool, serverDest, fuerte::RestVerb::Post,
"/_api/aql/setup", std::move(buffer), options,
std::move(headers))
"/_api/aql/setup", std::move(buffer),
options, std::move(headers))
.then([buildCallback = std::move(buildCallback)](futures::Try<network::Response>&& resp) mutable {
return buildCallback(resp);
});
Expand All @@ -373,7 +375,8 @@ bool EngineInfoContainerDBServerServerBased::isNotSatelliteLeader(VPackSlice inf
return true;
}

TRI_ASSERT((infoSlice.get("snippets").isObject() && !infoSlice.get("snippets").isEmptyObject()) ||
TRI_ASSERT((infoSlice.get("snippets").isObject() &&
!infoSlice.get("snippets").isEmptyObject()) ||
infoSlice.hasKey("traverserEngines"));

return false;
Expand Down Expand Up @@ -406,7 +409,7 @@ Result EngineInfoContainerDBServerServerBased::buildEngines(
TRI_ASSERT(!_closedSnippets.empty() || !_graphNodes.empty());

ErrorCode cleanupReason = TRI_ERROR_CLUSTER_TIMEOUT;

auto cleanupGuard = scopeGuard([this, &serverToQueryId, &cleanupReason]() {
// Fire and forget
std::ignore = cleanupEngines(cleanupReason, _query.vocbase().name(), serverToQueryId);
Expand All @@ -427,19 +430,21 @@ Result EngineInfoContainerDBServerServerBased::buildEngines(
options.timeout = network::Timeout(SETUP_TIMEOUT);
options.skipScheduler = true; // hack to speed up future.get()
options.param("ttl", std::to_string(_query.queryOptions().ttl));

TRI_IF_FAILURE("Query::setupTimeout") {
options.timeout = network::Timeout(0.01 + (double) RandomGenerator::interval(uint32_t(10)));
options.timeout =
network::Timeout(0.01 + (double)RandomGenerator::interval(uint32_t(10)));
}

TRI_IF_FAILURE("Query::setupTimeoutFailSequence") {
options.timeout = network::Timeout(0.5);
}

/// cluster global query id, under which the query will be registered
/// on DB servers from 3.8 onwards.
QueryId clusterQueryId = _query.vocbase().server().getFeature<ClusterFeature>().clusterInfo().uniqid();

QueryId clusterQueryId =
_query.vocbase().server().getFeature<ClusterFeature>().clusterInfo().uniqid();

// decreases lock timeout manually for fast path
auto oldLockTimeout = _query.getLockTimeout();
_query.setLockTimeout(FAST_PATH_LOCK_TIMEOUT);
Expand All @@ -449,7 +454,8 @@ Result EngineInfoContainerDBServerServerBased::buildEngines(
for (ServerID const& server : dbServers) {
// Build Lookup Infos
VPackBuilder infoBuilder;
auto didCreateEngine = buildEngineInfo(clusterQueryId, infoBuilder, server, nodesById, nodeAliases);
auto didCreateEngine =
buildEngineInfo(clusterQueryId, infoBuilder, server, nodesById, nodeAliases);
VPackSlice infoSlice = infoBuilder.slice();

if (isNotSatelliteLeader(infoSlice)) {
Expand All @@ -468,7 +474,7 @@ Result EngineInfoContainerDBServerServerBased::buildEngines(
.thenValue([](std::vector<arangodb::futures::Try<Result>>&& responses) -> Result {
// We can directly report a non TRI_ERROR_LOCK_TIMEOUT
// error as we need to abort after.
// Otherwise we need to report
// Otherwise we need to report
Result res{TRI_ERROR_NO_ERROR};
for (auto const& tryRes : responses) {
auto response = tryRes.get();
Expand Down Expand Up @@ -498,16 +504,18 @@ Result EngineInfoContainerDBServerServerBased::buildEngines(

{
// in case of fast path failure, we need to cleanup engines
auto requests = cleanupEngines(fastPathResult.get().errorNumber(), _query.vocbase().name(), serverToQueryId);
auto requests = cleanupEngines(fastPathResult.get().errorNumber(),
_query.vocbase().name(), serverToQueryId);
// Wait for all requests to complete.
// So we know that all Transactions are aborted.
// We do NOT care for the actual result.
futures::collectAll(requests).wait();
snippetIds.clear();
}

// we must generate a new query id, because the fast path setup has failed
clusterQueryId = _query.vocbase().server().getFeature<ClusterFeature>().clusterInfo().uniqid();
clusterQueryId =
_query.vocbase().server().getFeature<ClusterFeature>().clusterInfo().uniqid();

// set back to default lock timeout for slow path fallback
_query.setLockTimeout(oldLockTimeout);
Expand All @@ -521,7 +529,8 @@ Result EngineInfoContainerDBServerServerBased::buildEngines(
std::sort(engineInformation.begin(), engineInformation.end(),
[](auto const& lhs, auto const& rhs) {
// Entry <0> is the Server
return TransactionState::ServerIdLessThan(std::get<0>(lhs), std::get<0>(rhs));
return TransactionState::ServerIdLessThan(std::get<0>(lhs),
std::get<0>(rhs));
});
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
// Make sure we always maintain the correct ordering of servers
Expand All @@ -547,7 +556,9 @@ Result EngineInfoContainerDBServerServerBased::buildEngines(
overwrittenOptions.add("clusterQueryId", VPackValue(clusterQueryId));
addOptionsPart(overwrittenOptions, server);
overwrittenOptions.close();
auto newRequest = arangodb::velocypack::Collection::merge(infoSlice, overwrittenOptions.slice(), false);
auto newRequest =
arangodb::velocypack::Collection::merge(infoSlice,
overwrittenOptions.slice(), false);

auto request = buildSetupRequest(trx, std::move(server), newRequest.slice(),
std::move(didCreateEngine), snippetIds, serverToQueryId,
Expand Down Expand Up @@ -680,7 +691,7 @@ std::vector<arangodb::network::FutureRes> EngineInfoContainerDBServerServerBased
options.database = dbname;
options.timeout = network::Timeout(10.0); // Picked arbitrarily
options.skipScheduler = true; // hack to speed up future.get()

// Shutdown query snippets
std::string url("/_api/aql/finish/");
VPackBuffer<uint8_t> body;
Expand All @@ -691,8 +702,8 @@ std::vector<arangodb::network::FutureRes> EngineInfoContainerDBServerServerBased
requests.reserve(serverQueryIds.size());
for (auto const& [server, queryId] : serverQueryIds) {
requests.emplace_back(network::sendRequestRetry(pool, server, fuerte::RestVerb::Delete,
url + std::to_string(queryId),
/*copy*/ body, options));
url + std::to_string(queryId),
/*copy*/ body, options));
}
_query.incHttpRequests(static_cast<unsigned>(serverQueryIds.size()));

Expand All @@ -703,8 +714,9 @@ std::vector<arangodb::network::FutureRes> EngineInfoContainerDBServerServerBased
for (auto& gn : _graphNodes) {
auto allEngines = gn->engines();
for (auto const& engine : *allEngines) {
requests.emplace_back(network::sendRequestRetry(pool, "server:" + engine.first, fuerte::RestVerb::Delete,
url + basics::StringUtils::itoa(engine.second), noBody, options));
requests.emplace_back(network::sendRequestRetry(
pool, "server:" + engine.first, fuerte::RestVerb::Delete,
url + basics::StringUtils::itoa(engine.second), noBody, options));
}
_query.incHttpRequests(static_cast<unsigned>(allEngines->size()));
gn->clearEngines();
Expand Down
43 changes: 22 additions & 21 deletions arangod/Aql/EngineInfoContainerDBServerServerBased.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace network {
class ConnectionPool;
struct RequestOptions;
struct Response;
}
} // namespace network

namespace velocypack {
class Builder;
Expand All @@ -56,6 +56,9 @@ class QuerySnippet;

class EngineInfoContainerDBServerServerBased {
private:
// TODO Temporary. Do not check in!!
// We need to access the TraverserEngineShardList nothing else.
public:
// @brief Local struct to create the
// information required to build traverser engines
// on DB servers.
Expand Down Expand Up @@ -123,7 +126,6 @@ class EngineInfoContainerDBServerServerBased {
// the given queryid of the coordinator as data provider.
void closeSnippet(QueryId inputSnippet);


// Build the Engines for the DBServer
// * Creates one Query-Entry for each Snippet per Shard (multiple on the
// same DB)
Expand All @@ -140,28 +142,28 @@ class EngineInfoContainerDBServerServerBased {
MapRemoteToSnippet& snippetIds, aql::ServerQueryIdList& serverQueryIds,
std::map<ExecutionNodeId, ExecutionNodeId>& nodeAliases);


// Insert a GraphNode that needs to generate TraverserEngines on
// the DBServers. The GraphNode itself will retain on the coordinator.
void addGraphNode(GraphNode* node, bool pushToSingleServer);

private:
/**
* @brief Helper method to generate the Request to be send to a specific database server.
* this request contains all the necessary information to create a transaction with correct shard
* locking, as well as QuerySnippets and GraphEngines on the receiver side.
*
* @param clusterQueryId cluster-wide query id (used from 3.8 onwards)
* @param infoBuilder (mutable) the request body will be written into this builder.
* @param server The DatabaseServer we suppose to send the request to, used to identify the shards on this server
* @param nodesById A vector to get Nodes by their id.
* @param nodeAliases (mutable) A map of node-aliases, if a server is responsible for more then one shard we need to duplicate some nodes in the query (e.g. an IndexNode can only access one shard at a time) this list can map cloned node -> original node ids.
*
* @return A vector with one entry per GraphNode in the query (in order) it indicates if this Server has created a GraphEngine for this Node and needs to participate in the GraphOperation or not.
*/
std::vector<bool> buildEngineInfo(QueryId clusterQueryId, VPackBuilder& infoBuilder, ServerID const& server,
std::unordered_map<ExecutionNodeId, ExecutionNode*> const& nodesById,
std::map<ExecutionNodeId, ExecutionNodeId>& nodeAliases);
* @brief Helper method to generate the Request to be send to a specific database server.
* this request contains all the necessary information to create a transaction with correct shard
* locking, as well as QuerySnippets and GraphEngines on the receiver side.
*
* @param clusterQueryId cluster-wide query id (used from 3.8 onwards)
* @param infoBuilder (mutable) the request body will be written into this builder.
* @param server The DatabaseServer we suppose to send the request to, used to identify the shards on this server
* @param nodesById A vector to get Nodes by their id.
* @param nodeAliases (mutable) A map of node-aliases, if a server is responsible for more then one shard we need to duplicate some nodes in the query (e.g. an IndexNode can only access one shard at a time) this list can map cloned node -> original node ids.
*
* @return A vector with one entry per GraphNode in the query (in order) it indicates if this Server has created a GraphEngine for this Node and needs to participate in the GraphOperation or not.
*/
std::vector<bool> buildEngineInfo(
QueryId clusterQueryId, VPackBuilder& infoBuilder, ServerID const& server,
std::unordered_map<ExecutionNodeId, ExecutionNode*> const& nodesById,
std::map<ExecutionNodeId, ExecutionNodeId>& nodeAliases);

arangodb::futures::Future<Result> buildSetupRequest(
transaction::Methods& trx, ServerID const& server, VPackSlice infoSlice,
Expand All @@ -171,7 +173,6 @@ class EngineInfoContainerDBServerServerBased {

[[nodiscard]] bool isNotSatelliteLeader(VPackSlice infoSlice) const;


/**
* @brief Will send a shutdown to all engines registered in the list of
* queryIds.
Expand All @@ -186,8 +187,8 @@ class EngineInfoContainerDBServerServerBased {
* -> queryid.
*/
std::vector<futures::Future<network::Response>> cleanupEngines(
ErrorCode errorCode, std::string const& dbname, aql::ServerQueryIdList& serverQueryIds) const;

ErrorCode errorCode, std::string const& dbname,
aql::ServerQueryIdList& serverQueryIds) const;

// Insert the Locking information into the message to be send to DBServers
void addLockingPart(arangodb::velocypack::Builder& builder, ServerID const& server) const;
Expand Down
Loading
0