8000 Bug fix/check for kill more consistently (#13514) · tylde/arangodb@fa49a03 · GitHub
[go: up one dir, main page]

Skip to content

Commit fa49a03

Browse files
goedderzjsteemann
andauthored
Bug fix/check for kill more consistently (arangodb#13514)
Co-authored-by: Jan <jsteemann@users.noreply.github.com>
1 parent 846ce5f commit fa49a03

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
devel
22
-----
33

4+
* Issue #13141: The `move-filters-into-enumerate` optimization, when applied to
5+
an EnumerateCollectionNode (i.e. full collection scan), did not do regular
6+
checks for the query being killed during the filtering of documents, resulting
7+
in the maxRuntime option and manual kill of a query not working timely.
8+
49
* Simplify the DistributeExecutor and avoid implicit modification of its input
510
variable. Previously the DistributeExecutor could update the input variable
611
in-place, leading to unexpected results (see #13509).

arangod/Aql/DocumentProducingHelper.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ bool DocumentProducingFunctionContext::checkFilter(
286286
}
287287

288288
bool DocumentProducingFunctionContext::checkFilter(ExpressionContext& ctx) {
289-
if (ADB_UNLIKELY(_numScanned % 1024 == 0 && _query.killed())) {
289+
_killCheckCounter = (_killCheckCounter + 1) % 1024;
290+
if (ADB_UNLIKELY(_killCheckCounter == 0 && _query.killed())) {
290291
THROW_ARANGO_EXCEPTION(TRI_ERROR_QUERY_KILLED);
291292
}
292293

arangod/Aql/DocumentProducingHelper.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ struct DocumentProducingFunctionContext {
126126
arangodb::aql::Projections const& _projections;
127127
size_t _numScanned;
128128
size_t _numFiltered;
129+
uint_fast16_t _killCheckCounter = 0;
129130

130131
/// @brief Builder that is reused to generate projection results
131132
arangodb::velocypack::Builder _objectBuilder;

0 commit comments

Comments
 (0)
0