diff --git a/CHANGELOG b/CHANGELOG index 46b6878b4f..63421379d2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -166,6 +166,14 @@ v2.4.0 (XXXX-XX-XX) * HTTP GET `/_api/replication/logger-config` * HTTP PUT `/_api/replication/logger-config` +* fixed issue #1174, which was due to locking problems in distributed + AQL execution + +* improved cluster locking for AQL avoiding deadlocks + +* use DistributeNode for modifying queries with REPLACE and UPDATE, if + possible + v2.3.3 (2014-12-17) ------------------- diff --git a/arangod/Aql/ExecutionBlock.cpp b/arangod/Aql/ExecutionBlock.cpp index ba54b4f7d7..c4091071a1 100644 --- a/arangod/Aql/ExecutionBlock.cpp +++ b/arangod/Aql/ExecutionBlock.cpp @@ -4987,17 +4987,29 @@ size_t DistributeBlock::sendToClient (AqlValue val) { "DistributeBlock: can only send JSON or SHAPED"); } + bool mustFreeJson = false; + TRI_json_t* obj = nullptr; + if (TRI_IsStringJson(json)) { + obj = TRI_CreateObject2Json(TRI_UNKNOWN_MEM_ZONE, 1); + TRI_InsertObjectJson(TRI_UNKNOWN_MEM_ZONE, obj, "_key", json); + mustFreeJson = true; + } + std::string shardId; bool usesDefaultShardingAttributes; auto clusterInfo = triagens::arango::ClusterInfo::instance(); auto const planId = triagens::basics::StringUtils::itoa(_collection->getPlanId()); int res = clusterInfo->getResponsibleShard(planId, - json, + mustFreeJson ? obj : json, true, shardId, usesDefaultShardingAttributes); + if (mustFreeJson) { + TRI_FreeJson(TRI_UNKNOWN_MEM_ZONE, obj); + } + if (res != TRI_ERROR_NO_ERROR) { THROW_ARANGO_EXCEPTION(res); } diff --git a/js/common/tests/shell-explain-cluster.js b/js/common/tests/shell-explain-cluster.js index 718ce6169e..a53bfa17be 100644 --- a/js/common/tests/shell-explain-cluster.js +++ b/js/common/tests/shell-explain-cluster.js @@ -419,7 +419,7 @@ function ExplainSuite () { assertEqual("GatherNode", node.type); node = nodes[5]; - assertEqual("ScatterNode", node.type); + assertEqual("DistributeNode", node.type); node = nodes[6]; assertEqual("RemoteNode", node.type); @@ -461,7 +461,7 @@ function ExplainSuite () { assertEqual("GatherNode", node.type); node = nodes[5]; - assertEqual("ScatterNode", node.type); + assertEqual("DistributeNode", node.type); node = nodes[6]; assertEqual("RemoteNode", node.type); @@ -500,7 +500,7 @@ function ExplainSuite () { assertEqual("GatherNode", node.type); node = nodes[4]; - assertEqual("ScatterNode", node.type); + assertEqual("DistributeNode", node.type); node = nodes[5]; assertEqual("RemoteNode", node.type); @@ -540,7 +540,7 @@ function ExplainSuite () { assertEqual("GatherNode", node.type); node = nodes[4]; - assertEqual("ScatterNode", node.type); + assertEqual("DistributeNode", node.type); node = nodes[5]; assertEqual("RemoteNode", node.type); @@ -582,7 +582,7 @@ function ExplainSuite () { assertEqual("GatherNode", node.type); node = nodes[5]; - assertEqual("ScatterNode", node.type); + assertEqual("DistributeNode", node.type); node = nodes[6]; assertEqual("RemoteNode", node.type); @@ -625,7 +625,7 @@ function ExplainSuite () { assertEqual("GatherNode", node.type); node = nodes[5]; - assertEqual("ScatterNode", node.type); + assertEqual("DistributeNode", node.type); node = nodes[6]; assertEqual("RemoteNode", node.type); @@ -664,7 +664,7 @@ function ExplainSuite () { assertEqual("GatherNode", node.type); node = nodes[4]; - assertEqual("ScatterNode", node.type); + assertEqual("DistributeNode", node.type); node = nodes[5]; assertEqual("RemoteNode", node.type); @@ -703,7 +703,7 @@ function ExplainSuite () { assertEqual("GatherNode", node.type); node = nodes[4]; - assertEqual("ScatterNode", node.type); + assertEqual("DistributeNode", node.type); node = nodes[5]; assertEqual("RemoteNode", node.type); diff --git a/m4/external.openssl b/m4/external.openssl index 5591415087..0d98a20df5 100644 --- a/m4/external.openssl +++ b/m4/external.openssl @@ -131,8 +131,6 @@ LDFLAGS="$SAVE_LDFLAGS" CPPFLAGS="$SAVE_CPPFLAGS" LIBS="$SAVE_LIBS" -OPENSSL_CPPFLAGS="${OPENSSL_CPPFLAGS} -DTRI_OPENSSL_VERSION='${TRI_OPENSSL_VERSION}'" - dnl ----------------------------------------------------------------------------------------- dnl informational output dnl -----------------------------------------------------------------------------------------