8000 Bug fix 3.5/fix smart join restrictions (#9534) · arangodb/arangodb@313d60e · GitHub
[go: up one dir, main page]

Skip to content

Commit 313d60e

Browse files
jsteemannKVS85
authored andcommitted
Bug fix 3.5/fix smart join restrictions (#9534)
* fixed a query abort error with smart joins if both collections were restricted to a single shard using the "restrict-to-single-shard" optimizer rule * updated CHANGELOG * try to fix Windows build error
1 parent 9b62f07 commit 313d60e

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
v3.5.0-rc.5 (2019-XX-XX)
22
------------------------
33

4+
* Fixed a query abort error with smart joins if both collections were restricted to a
5+
single shard using the "restrict-to-single-shard" optimizer rule.
6+
47
* Fixed a performance regression of COLLECT WITH COUNT INTO.
58

69
* Fixed some races in cluster collection creation, which allowed collections with the

arangod/Aql/EngineInfoContainerDBServer.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,7 @@ void EngineInfoContainerDBServer::EngineInfo::addNode(ExecutionNode* node) {
171171
TRI_ASSERT(sourceImpl);
172172

173173
if (node->isRestricted()) {
174-
TRI_ASSERT(sourceImpl->restrictedShard.empty());
175-
sourceImpl->restrictedShard = node->restrictedShard();
174+
sourceImpl->restrictedShards.emplace(node->restrictedShard());
176175
}
177176
};
178177

@@ -315,10 +314,10 @@ void EngineInfoContainerDBServer::EngineInfo::serializeSnippet(
315314
bool isResponsibleForInitializeCursor) const {
316315
auto* collection = boost::get<CollectionSource>(&_source);
317316
TRI_ASSERT(collection);
318-
auto& restrictedShard = collection->restrictedShard;
317+
auto const& restrictedShards = collection->restrictedShards;
319318

320-
if (!restrictedShard.empty()) {
321-
if (id != restrictedShard) {
319+
if (!restrictedShards.empty()) {
320+
if (restrictedShards.find(id) == restrictedShards.end()) {
322321
return;
323322
}
324323
// We only have one shard it has to be responsible!

arangod/Aql/EngineInfoContainerDBServer.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ class EngineInfoContainerDBServer {
8888
explicit EngineInfo(size_t idOfRemoteNode) noexcept;
8989
EngineInfo(EngineInfo&& other) noexcept;
9090
~EngineInfo();
91-
EngineInfo(EngineInfo&) = delete;
9291
EngineInfo(EngineInfo const& other) = delete;
9392

9493
#if (_MSC_VER != 0)
@@ -124,14 +123,11 @@ class EngineInfoContainerDBServer {
124123

125124
private:
126125
struct CollectionSource {
127-
explicit CollectionSource(aql::Collection* collection) noexcept
128-
: collection(collection) {
129-
}
130-
CollectionSource(CollectionSource&&) = default;
131-
CollectionSource& operator=(CollectionSource&&) = default;
126+
explicit CollectionSource(aql::Collection* collection)
127+
: collection(collection) {}
132128

133129
aql::Collection* collection{}; // The collection used to connect to this engine
134-
std::string restrictedShard; // The shard this snippet is restricted to
130+
std::unordered_set<std::string> restrictedShards{}; // The shards this snippet is restricted to
135131
};
136132

137133
struct ViewSource {

0 commit comments

Comments
 (0)
0