10000 Feature/hybrid smart graph test setup helper by mchacki · Pull Request #14455 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Feature/hybrid smart graph test setup helper #14455

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 8000 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
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
780a86c
Added Protected default constructor for Valdiators
mchacki Apr 20, 2021
b246d14
Make createKey constant
mchacki Apr 22, 2021
56bf5ef
Prepare to use an internal Validator that is not user-modifyable. Thi…
mchacki Apr 22, 2021
579230b
Make setIntenralValidator a public method so we can actually call it …
mchacki Apr 22, 2021
1a74899
todo
hkernbach Apr 22, 2021
4231ca4
add satellites to GraphNode v2
hkernbach Apr 22, 2021
8958c0b
add satellites to shard locking
hkernbach Apr 22, 2021
594b916
typo
hkernbach Apr 22, 2021
29479d0
added comments to some methods
hkernbach Apr 23, 2021
1eec739
adjusted shard locking
hkernbach Apr 23, 2021
663e6a2
extended getAllLocalShards
hkernbach Apr 23, 2021
f751a6c
remove not needed methods
hkernbach Apr 23, 2021
b6390d9
Add a place to inject internal Schema validation, used e.g. to valida…
mchacki Apr 26, 2021
3208a80
Merge remote-tracking branch 'origin' into feature/use-validators-on-…
mchacki Apr 26, 2021
eaca7ce
Disabled enterprise Validator Factory
mchacki Apr 27, 2021
5113205
Removed ValidatorFactory, we do it in a different way
mchacki Apr 27, 2021
b113a36
Merge branch 'feature/hybrid-smart-graph' of github.com:arangodb/aran…
hkernbach Apr 28, 2021
0c90d99
Merge branch 'feature/use-validators-on-smart-edge-collections' of gi…
hkernbach Apr 28, 2021
63f4ed2
Merge branch 'feature/hybrid-smart-graph' of github.com:arangodb/aran…
hkernbach May 4, 2021
d869fa2
Merge branch 'feature/hybrid-smart-graph' of github.com:arangodb/aran…
hkernbach May 4, 2021
f97e342
Added more template instanciations
mchacki May 5, 2021
c01bec8
Make collection to shard map a map of string -> vector<string>, requi…
mchacki May 5, 2021
cb9f78f
changed api of getNextPath, not modifying builder but returning PathR…
hkernbach May 5, 2021
add77c8
First draft of toSchreierEntry for HTTP transport. This is a hacky va…
mchacki May 6, 2021
dce04f4
Simplified SingleProviderPathResult and EdgeDocument token.
mchacki May 6, 2021
532ad82
typo, adjusted format for first step in schreier format
hkernbach May 7, 2021
0eb70ef
tmp enable smartSearchNew for testing
hkernbach May 7, 2021
877a6a7
add start/reset depth parameter, default is 0
hkernbach May 10, 2021
220aa99
added dfspathfinder path_loop test
hkernbach May 10, 2021
09337ed
added dfspathfinder triangle_loop test
hkernbach May 10, 2021
86360fe
added dfspathfinder triangle_loop_skip test
hkernbach May 10, 2021
310e321
change log ids, adjust later (added todo), in order to perform jenkin…
hkernbach May 11, 2021
3ad7e6a
remove type from toVelocyPack and addToBuilder
hkernbach May 11, 2021
c7b6a11
rm isHybrid, modified pathvalidator templates
hkernbach May 12, 2021
88bfc65
Fixed compile issue in DFSFinderTest
mchacki May 14, 2021
f819f6a
First draft to include a generice Enumerator Interface, that can be u…
mchacki May 14, 2021
6282568
Merge branch 'feature/hybrid-smart-graph' of github.com:arangodb/aran…
hkernbach Jun 1, 2021
847afd3
Merge branch 'feature/hybrid-smart-graph-testsuite' of github.com:ara…
hkernbach Jun 1, 2021
94f0ab4
Moved to a Configuration based Enumerator Template. This way it is mu…
mchacki May 14, 2021
73b0038
Merge branch 'feature/hybrid-smart-graph' of github.com:arangodb/aran…
hkernbach Jun 1, 2021
9fa2e7d
Prepared PathValidatorOpitons to contain Prune condition
mchacki Jun 2, 2021
e44fcbe
Added ValidatorOptions and Provider information to Validator. This is…
mchacki Jun 2, 2021
ecf685f
Implemented evaluateEdgeCondition, however no one sets an edgeConditi…
mchacki Jun 2, 2021
afdc047
Make Temporary builder reusable.
mchacki Jun 2, 2021
55ec101
Moved from Edge Condition to VertexCondition. The EdgeCondition canno…
mchacki Jun 7, 2021
1b49c0e
preperation for evaluateExpression, not done yet
hkernbach Jun 7, 2021
d0ff849
prep for include of expression in indexaccessor
hkernbach Jun 8, 2021
6c13a95
return false in callback
hkernbach Jun 8, 2021
2c2557f
broken trx state
hkernbach Jun 8, 2021
7960fa1
Switched std::optional with std::unique_ptr. Somehow std::optional of…
mchacki Jun 8, 2021
9c62834
Very first draft of a PathValidatorTest based on Vertex conditions. T…
mchacki Jun 8, 2021
b4ea993
Fixed nullptr access
mchacki Jun 8, 2021
3f7ded0
still broken, transactionState cookies acceess, wip, pointer instead …
hkernbach Jun 8, 2021
097d246
Merge branch 'feature/hybrid-smart-graph-testsuite' of github.com:ara…
hkernbach Jun 8, 2021
05d17df
tmp commit - needs to be reverted before merge!
hkernbach Jun 9, 2021
e3dc6b7
Make BaseStep copy and movable
mchacki Jun 9, 2021
129da07
MockGraphProvidder now uses default step destructor
mchacki Jun 9, 2021
2b693d2
Started rewireing PathValidatorTest to use GraphMockProvider. Most te…
mchacki Jun 9, 2021
7874264
Rewritten and activated more tests for validator
mchacki Jun 9, 2021
ddaf7b0
All basic vertex tests are back online
mchacki Jun 9, 2021
751586c
Implemented a reset method in PathValidator, and used in in test.
mchacki Jun 9, 2021
a99554e
Fixed potentially out of scope for String
mchacki Jun 9, 2021
830d9b4
Implemented a very rough draft for SingleServerProvider Test
mchacki Jun 9, 2021
2f7bad6
Merge remote-tracking branch 'origin/devel' into feature/hybrid-smart…
mchacki Jun 10, 2021
3f5b04f
Fixed invalid memory access after parent move
mchacki Jun 10, 2021
c7eca19
Removed temporary debug output
mchacki Jun 10, 2021
a640b41
Merge branch 'feature/hybrid-smart-graph' of github.com:arangodb/aran…
hkernbach Jun 10, 2021
053e96c
Removed twice lookup of Document
mchacki Jun 10, 2021
f9b4747
pass-through all index information (depth and global)
hkernbach Jun 10, 2021
42c5e7a
remove log
hkernbach Jun 10, 2021
fc022b3
Register TransactionManager Feature in MockServers
mchacki Jun 11, 2021
0a6c535
Include nextExtra implementation in MockEdgeIndex. This is what will …
mchacki Jun 11, 2021
1404011
Moved Mock Test classes into MockFolder and include it in all tests f…
mchacki Jun 11, 2021
f8dacd9
Fixed EdgeIndexMock, it was only able to return exactly on time the l…
mchacki Jun 11, 2021
9ef5bc8
Actually count read edges
mchacki Jun 11, 2021
039fbdd
enabled depth based expressions
hkernbach Jun 11, 2021
523da6a
Merge branch 'feature/hybrid-smart-graph-testsuite' of github.com:ara…
hkernbach Jun 11, 2021
079017a
Allow to set or overwrite a variable in a FixedVarContext
mchacki Jun 11, 2021
53a65ce
Forward the FixedVarExpression Context into the Provider. This way it…
mchacki Jun 11, 2021
1e1f934
use shared expressionContext in PathValidator as well
hkernbach Jun 11, 2021
2372616
Move ValidatorOptions into the Enumerators. Also made the ValidatorOp…
mchacki Jun 14, 2021
26f7f91
Fixed Assertion in Cpp test
mchacki Jun 14, 2021
153b8fd
First rule of Results: Do not throw them, throw ARANGODB_EXCEPTION
mchacki Jun 14, 2021
91565e5
fixed one test - wrong scannedIndex in original test
hkernbach Jun 14, 2021
dcc2c77
Merge branch 'feature/hybrid-smart-graph-testsuite' of github.com:ara…
hkernbach Jun 14, 2021
b86b835
Poor persons workaround for loose end processing. This is not good, b…
mchacki Jun 14, 2021
ef8d7d0
modified complexFilteringSuite
hkernbach Jun 14, 2021
c51553d
modified optimizeQuantifierSuite
hkernbach Jun 14, 2021
2380ca7
Merge branch 'feature/hybrid-smart-graph' of github.com:arangodb/aran…
hkernbach Jun 14, 2021
b38fe3f
adjusted testModify
hkernbach Jun 15, 2021
c30989b
fixed queue type in DFS Enumerator Queue
hkernbach Jun 15, 2021
fd3fa59
added isCluster section to test
hkernbach Jun 15, 2021
72b4f93
Made Expressions use shared_ptr in path validator. We can happily reu…
mchacki Jun 15, 2021
7887420
allow to restrict collections
hkernbach Jun 15, 2021
1eaa27d
Merge branch 'feature/hybrid-smart-graph-testsuite' of github.com:ara…
hkernbach Jun 15, 2021
5ee84fc
fixed cpp test compilation
hkernbach Jun 16, 2021
d315a04
added method to shard to check wheter we're responsible
hkernbach Jun 18, 2021
83d5d91
trying to fix se search with lookupTable
hkernbach Jun 18, 2021
6559d38
added isResponsible method to mock provider step
hkernbach Jun 21, 2021
bed40c2
implemented schreier path building
hkernbach Jun 21, 2021
e957a22
Merge branch 'feature/hybrid-smart-graph' of github.com:arangodb/aran…
hkernbach Jun 21, 2021
96b58aa
Fixed looseEndReporting.
mchacki Jun 22, 2021
2c87281
adjusted print method
hkernbach Jun 22, 2021
eda7279
Merge branch 'feature/hybrid-smart-gr 8000 aph-testsuite' of github.com:ara…
hkernbach Jun 22, 2021
4d6de4d
Let enumerator report Filtered Paths
mchacki Jun 22, 2021
c88f5de
removed obsolete comment
hkernbach Jun 22, 2021
7fc5a2d
Fixed unnecessary document lookup if the server is NOT responsible to…
mchacki Jun 23, 2021
817434e
Do not apply validators on Vertices the server is not responsible for…
mchacki Jun 23, 2021
d015160
Use a different method to get a transaction while preparing the Engin…
mchacki Jul 1, 2021
0d3a171
Expose registering of Indexes in ClusterIndexFactory
mchacki Jul 1, 2021
cfbab0d
Allow to create a FakeQuery for Coordiantor and DBServers in Mocks
mchacki Jul 1, 2021
523948c
Prepared MockServers to Link Indexes on Coordinator. This is required…
mchacki Jul 2, 2021
2ce8262
Fixed a MockOnly bug, that does cause nullptr access when shutting do…
mchacki Jul 2, 2021
faab49e
Included Temporary TraverserEngineShardList access. needs to be removed
mchacki Jul 2, 2021
fb6a8b3
Merge remote-tracking branch 'origin/feature/hybrid-smart-graph' into…
mchacki Jul 3, 2021
521a209
Update tests/Mocks/Servers.cpp
mchacki Jul 7, 2021
93dc786
Merge branch 'feature/hybrid-smart-graph' into feature/hybrid-smart-g…
mchacki Jul 7, 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
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"
#incl 8000 ude "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 6D24 .
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