File tree Expand file tree Collapse file tree 5 files changed +10
-12
lines changed Expand file tree Collapse file tree 5 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -1483,7 +1483,9 @@ aql::ExecutionState Query::cleanupTrxAndEngines(ErrorCode errorCode) {
1483
1483
}
1484
1484
bool usingSystemCollection = false ;
1485
1485
// Ignore queries on System collections, we do not want them to hit failure points
1486
- collections ().visit ([&usingSystemCollection](std::string const &, Collection& col) -> bool {
1486
+ // note that we must call the _const_ version of collections() here, because the non-const
1487
+ // version will trigger an assertion failure if the query is already executing!
1488
+ const_cast <Query const *>(this )->collections ().visit ([&usingSystemCollection](std::string const &, Collection const & col) -> bool {
1487
1489
if (col.getCollection ()->system ()) {
1488
1490
usingSystemCollection = true ;
1489
1491
return false ;
Original file line number Diff line number Diff line change 32
32
#include " Basics/VelocyPackHelper.h"
33
33
#include " Basics/system-functions.h"
34
34
#include " Cluster/ServerState.h"
35
+ #include " ClusterEngine/ClusterEngine.h"
35
36
#include " Graph/Graph.h"
36
37
#include " Graph/GraphManager.h"
37
38
#include " Logger/LogMacros.h"
@@ -53,7 +54,6 @@ using namespace arangodb::aql;
53
54
// / @brief creates a query
54
55
QueryContext::QueryContext (TRI_vocbase_t& vocbase, QueryId id)
55
56
: _resourceMonitor(GlobalResourceMonitor::instance()),
56
- _baseOverHeadTracker(_resourceMonitor, baseMemoryUsage),
57
57
_queryId(id ? id : TRI_NewServerSpecificTick()),
58
58
_collections(&vocbase),
59
59
_vocbase(vocbase),
@@ -76,9 +76,7 @@ QueryContext::~QueryContext() {
76
76
}
77
77
78
78
Collections& QueryContext::collections () {
79
- #ifndef ARANGODB_USE_GOOGLE_TESTS
80
- TRI_ASSERT (_execState != QueryExecutionState::ValueType::EXECUTION);
81
- #endif
79
+ TRI_ASSERT (_execState != QueryExecutionState::ValueType::EXECUTION || ClusterEngine::Mocking);
82
80
return _collections;
83
81
}
84
82
Original file line number Diff line number Diff line change @@ -146,9 +146,6 @@ class QueryContext {
146
146
// / @brief current resources and limits used by query
147
147
arangodb::ResourceMonitor _resourceMonitor;
148
148
149
- // / @brief registers/unregisters query base ovehead
150
- arangodb::ResourceUsageScope _baseOverHeadTracker;
151
-
152
149
TRI_voc_tick_t const _queryId;
153
150
154
151
// / @brief thread-safe query warnings collector
Original file line number Diff line number Diff line change @@ -408,10 +408,6 @@ std::unique_ptr<arangodb::aql::Query> MockAqlServer::createFakeQuery(
408
408
callback (*query);
409
409
query->prepareQuery (aql::SerializationFormat::SHADOWROWS);
410
410
411
- // auto engine =
412
- // std::make_unique<aql::ExecutionEngine>(*query, aql::SerializationFormat::SHADOWROWS);
413
- // query->setEngine(std::move(engine));
414
-
415
411
return query;
416
412
}
417
413
Original file line number Diff line number Diff line change 34
34
#include " Basics/Thread.h"
35
35
#include " Basics/icu-helper.h"
36
36
#include " Cluster/ServerState.h"
37
+ #include " ClusterEngine/ClusterEngine.h"
37
38
#include " Logger/LogAppender.h"
38
39
#include " Logger/Logger.h"
39
40
#include " Random/RandomGenerator.h"
@@ -133,6 +134,10 @@ int main(int argc, char* argv[]) {
133
134
arangodb::ServerState::instance ()->setRebootId (arangodb::RebootId{1 });
134
135
IcuInitializer::setup (ARGV0);
135
136
137
+ // enable mocking globally - not awesome, but helps to prevent runtime
138
+ // assertions in queries
139
+ arangodb::ClusterEngine::Mocking = true ;
140
+
136
141
// Run tests in subthread such that it has a larger stack size in libmusl,
137
142
// the stack size for subthreads has been reconfigured in the
138
143
// ArangoGlobalContext above in the libmusl case:
You can’t perform that action at this time.
0 commit comments