-
Notifications
You must be signed in to change notification settings - Fork 838
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
Feature/distribute simplification #13509
Conversation
…implification # Conflicts: # arangod/Aql/ClusterNodes.h
…implification # Conflicts: # arangod/Aql/AqlFunctionFeature.cpp
…function call to prepare the input.
…implification # Conflicts: # CHANGELOG
…implification # Conflicts: # CHANGELOG
Tests blue |
builder.add("createKeys", VPackValue(_createKeys)); | ||
builder.add("allowKeyConversionToObject", VPackValue(_allowKeyConversionToObject)); | ||
builder.add("fixupGraphInput", VPackValue(_fixupGraphInput)); | ||
builder.add(VPackValue("variable")); | ||
_variable->toVelocyPack(builder); | ||
builder.add(VPackValue("alternativeVariable")); | ||
_alternativeVariable->toVelocyPack(builder); | ||
_variable->toVelocyPack(builder);; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this doesn't break in case of rolling upgrades in the cluster, as coordinators are updated last.
However, it could break an older version of the explainer, which may check any of these attributes on a DistributeNode
. So we should prepare the explainer in 3.7 to handle the new DistributeNode type gracefully.
arangod/Aql/Functions.cpp
Outdated
// TODO - use ignoreErrors in all error cases? | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to do anything here? That is unclear to me as a reader of the code.
setInVariable = [updateReplaceNode](Variable* var) { | ||
updateReplaceNode->setInDocVariable(var); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell, the value of setInVariable
is the same for the if
and the else
parts, so it can be moved behind them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, in one case we call setInKeyVariable
, in the other setInDocVariable
.
Co-authored-by: jsteemann <jan@arangodb.com> Co-authored-by: Jan <jsteemann@users.noreply.github.com>
Scope & Purpose
Enterprise companion PR: arangodb/enterprise#647
Simplify the DistributeExecutor and avoid implicit modification of its input variable.
Previously the DistributeExecutor sometimes updated the input variable in-place, leading to unexpected results like in this example:
This query should return
{test: 1}
three times. Instead it returns:This PR moves the modification logic from the DistributeExecutor into three new internal AQL functions (
MAKE_DISTRIBUTE_INPUT
,MAKE_DISTRIBUTE_INPUT_WITH_KEY_CREATION
,MAKE_DISTRIBUTE_GRAPH_INPUT
). As a post-processing step after the optimization, we insert a new calculation node with the corresponding function call for each distribute node in the plan (if necessary). This is done in a post-processing step so that the calculation node does not interfere with any optimization rules operating on the distribute node and its variable,This change not only simplifies the DistributeExecutor, but also makes any additional calculation (if necessary) explicit and avoids unexpected results like in the previous example.
Backports:
Related Information
Testing & Verification