8000 Restrict hybrid disjoint sg directions by mchacki · Pull Request #16214 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Restrict hybrid disjoint sg directions #16214

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 16 commits into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter
8000

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
Exeternalize determineEnterpriseFlags of the GraphNode
  • Loading branch information
mchacki committed Apr 26, 2022
commit 93239576e6330fa85074b70b03d33f55e7a87091
44 changes: 10 additions & 34 deletions arangod/Aql/GraphNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ GraphNode::GraphNode(ExecutionPlan* plan, ExecutionNodeId id,
TRI_ASSERT(direction != nullptr);
TRI_ASSERT(graph != nullptr);

auto& ci = _vocbase->server().getFeature<ClusterFeature>().clusterInfo();
DisjointSmartToSatelliteTester disjointTest{};

if (graph->type == NODE_TYPE_COLLECTION_LIST) {
Expand All @@ -228,36 +227,7 @@ GraphNode::GraphNode(ExecutionPlan* plan, ExecutionNodeId id,
_edgeColls.reserve(edgeCollectionCount);
_directions.reserve(edgeCollectionCount);

// First determine whether all edge collections are smart and sharded
// like a common collection:
if (ServerState::instance()->isRunningInCluster()) {
_isSmart = true;
_isDisjoint = true;
std::string distributeShardsLike;
for (size_t i = 0; i < edgeCollectionCount; ++i) {
auto col = graph->getMember(i);
if (col->type == NODE_TYPE_DIRECTION) {
col = col->getMember(1); // The first member always is the collection
}
std::string n = col->getString();
auto c = ci.getCollection(_vocbase->name(), n);
if (c->isSmart() && !c->isDisjoint()) {
_isDisjoint = false;
}
if (!c->isSmart() || c->distributeShardsLike().empty()) {
_isSmart = false;
_isDisjoint = false;
break;
}
if (distributeShardsLike.empty()) {
distributeShardsLike = c->distributeShardsLike();
} else if (distributeShardsLike != c->distributeShardsLike()) {
_isSmart = false;
_isDisjoint = false;
break;
}
}
}
determineEnterpriseFlags(graph);

std::unordered_map<std::string, TRI_edge_direction_e> seenCollections;
CollectionNameResolver const& resolver = plan->getAst()->query().resolver();
Expand Down Expand Up @@ -354,13 +324,12 @@ GraphNode::GraphNode(ExecutionPlan* plan, ExecutionNodeId id,
THROW_ARANGO_EXCEPTION(TRI_ERROR_GRAPH_EMPTY);
}

// First determine whether all edge collections are smart and sharded
// like a common collection:
// Just use the Graph Object information
if (ServerState::instance()->isRunningInCluster()) {
_isSmart = _graphObj->isSmart();
_isDisjoint = _graphObj->isDisjoint();
}

auto& ci = _vocbase->server().getFeature<ClusterFeature>().clusterInfo();
auto& collections = plan->getAst()->query().collections();
for (const auto& n : eColls) {
if (_options->shouldExcludeEdgeCollection(n)) {
Expand Down Expand Up @@ -593,6 +562,13 @@ GraphNode::GraphNode(ExecutionPlan* plan, ExecutionNodeId id,
setGraphInfoAndCopyColls(edgeColls, vertexColls);
}

#ifndef USE_ENTERPRISE
void GraphNode::determineEnterpriseFlags() {
_isSmart = false;
_isDisjoint = false;
}
#endif

void GraphNode::setGraphInfoAndCopyColls(
std::vector<Collection*> const& edgeColls,
std::vector<Collection*> const& vertexColls) {
Expand Down
2 changes: 2 additions & 0 deletions arangod/Aql/GraphNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ class GraphNode : public ExecutionNode {

Collection const* getShardingPrototype() const;

void determineEnterpriseFlags(AstNode const* edgeCollectionList);

protected:
/// @brief the database
TRI_vocbase_t* _vocbase;
Expand Down
0