8000 partial revert of commit 140beedd04aa036438ffe77dc003cf2c03358313 · RtiWeb/arangodb@a236ac1 · GitHub
[go: up one dir, main page]

Skip to content

Commit a236ac1

Browse files
committed
partial revert of commit 140beed
1 parent 7155702 commit a236ac1

File tree

2 files changed

+5
-40
lines changed

2 files changed

+5
-40
lines changed

CHANGELOG

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,6 @@ devel
176176
honored and the soft limit will be set to either hard limit or system limit
177177
whichever is lower.
178178

179-
* Allow an INSERT operation for a multi-shard collection to execute in
180-
parallel on different DB servers.
181-
182179
* Fix BTS-409: return error 1948 when a negative edge was detected during or was
183180
used as default weight in a SHORTEST_PATH or a K_SHOTRTEST_PAHS traversal.
184181

arangod/Aql/OptimizerRules.cpp

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7426,14 +7426,10 @@ struct ParallelizableFinder final
74267426
: public WalkerWorker<ExecutionNode, WalkerUniqueness::NonUnique> {
74277427
bool const _parallelizeWrites;
74287428
bool _isParallelizable;
7429-
bool _seenDistribute;
7430-
uint32_t _numRemotes;
74317429

74327430
explicit ParallelizableFinder(bool parallelizeWrites)
74337431
: _parallelizeWrites(parallelizeWrites),
7434-
_isParallelizable(true),
7435-
_seenDistribute(false),
7436-
_numRemotes(0) {}
7432+
_isParallelizable(true) {}
74377433

74387434
~ParallelizableFinder() = default;
74397435

@@ -7443,38 +7439,11 @@ struct ParallelizableFinder final
74437439

74447440
bool before(ExecutionNode* node) override final {
74457441
if (node->getType() == ExecutionNode::SCATTER ||
7446-
node->getType() == ExecutionNode::GATHER) {
7442+
node->getType() == ExecutionNode::GATHER ||
7443+
node->getType() == ExecutionNode::DISTRIBUTE) {
74477444
_isParallelizable = false;
74487445
return true; // true to abort the whole walking process
74497446
}
7450-
if (node->getType() == ExecutionNode::DISTRIBUTE) {
7451-
if (_seenDistribute) {
7452-
// if we find 2 DISTRIBUTE nodes in the plan, or a DISTRIBUTE
7453-
// at an unexpected place, we give up
7454-
_isParallelizable = false;
7455-
return true;
7456-
}
7457-
// note that we have seen a DISTRIBUTE node.
7458-
// note that a single DISTRIBUTE node should be safe if it
7459-
// itself does not reach out to other snippets.
7460-
// The reason it should be safe is that the DISTRIBUTE will
7461-
// be executed under the snippet's mutex, so any real parallelism
7462-
// on the same DISTRIBUTE node is prevented. if multiple
7463-
// DB ervers are queuing for the same DISTRIBUTE node, this may
7464-
// lead to some contention, but should work eventually.
7465-
_seenDistribute = true;
7466-
}
7467-
if (node->getType() == ExecutionNode::REMOTE) {
7468-
// plan walking starts at a GATHER node, so we expect to see
7469-
// at least one REMOTE node.
7470-
// if we find another one, it is ok if that REMOTE node refers
7471-
// to a DISTRIBUTE node (checked above). if it refers to another
7472-
// GATHER node somewhere, we also abort above.
7473-
if (++_numRemotes > 2 || _seenDistribute) {
7474-
_isParallelizable = false;
7475-
return true;
7476-
}
7477-
}
74787447

74797448
if (node->getType() == ExecutionNode::TRAVERSAL ||
74807449
node->getType() == ExecutionNode::SHORTEST_PATH ||
@@ -7493,7 +7462,6 @@ struct ParallelizableFinder final
74937462
(!_parallelizeWrites ||
74947463
(node->getType() != ExecutionNode::REMOVE &&
74957464
node->getType() != ExecutionNode::REPLACE &&
7496-
node->getType() != ExecutionNode::INSERT &&
74977465
node->getType() != ExecutionNode::UPDATE))) {
74987466
_isParallelizable = false;
74997467
return true; // true to abort the whole walking process
@@ -7838,10 +7806,10 @@ void arangodb::aql::parallelizeGatherRule(Optimizer* opt,
78387806
::arangodb::containers::SmallVector<ExecutionNode*> nodes{a};
78397807
plan->findNodesOfType(nodes, EN::GATHER, true);
78407808

7841-
if (nodes.size() == 1 && !plan->contains(EN::SCATTER)) {
7842-
GatherNode* gn = ExecutionNode::castTo<GatherNode*>(nodes[0]);
7809+
if (nodes.size() == 1 && !plan->contains(EN::DISTRIBUTE) && !plan->contains(EN::SCATTER)) {
78437810
TRI_vocbase_t& vocbase = plan->getAst()->query().vocbase();
78447811
bool parallelizeWrites = vocbase.server().getFeature<OptimizerRulesFeature>().parallelizeGatherWrites();
7812+
GatherNode* gn = ExecutionNode::castTo<GatherNode*>(nodes[0]);
78457813

78467814
if (!gn->isInSubquery() && isParallelizable(gn, parallelizeWrites)) {
78477815
// find all graph nodes and make sure that they all are using satellite

0 commit comments

Comments
 (0)
0