From 5f442ef742bfaa640fa368316e2bffefb6d613fc Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Thu, 23 Jan 2014 11:47:49 +0100 Subject: [PATCH 1/4] bugfixes --- arangod/Cluster/ClusterInfo.h | 2 +- arangod/Cluster/v8-cluster.cpp | 3 +-- js/server/modules/org/arangodb/cluster.js | 21 +++++++++++++++------ 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/arangod/Cluster/ClusterInfo.h b/arangod/Cluster/ClusterInfo.h index b710b780e7..e295975627 100644 --- a/arangod/Cluster/ClusterInfo.h +++ b/arangod/Cluster/ClusterInfo.h @@ -595,7 +595,7 @@ namespace triagens { if (it != _jsons.end()) { TRI_json_t* _json = _jsons.begin()->second; return triagens::basics::JsonHelper::getStringValue - (_json, "DBserver", ""); + (_json, "DBServer", ""); } return string(""); } diff --git a/arangod/Cluster/v8-cluster.cpp b/arangod/Cluster/v8-cluster.cpp index f38a5bae8e..ec9707e9d5 100644 --- a/arangod/Cluster/v8-cluster.cpp +++ b/arangod/Cluster/v8-cluster.cpp @@ -845,8 +845,7 @@ static v8::Handle JS_GetCollectionInfoCurrentClusterInfo (v8::Argumen result->Set(v8::String::New("waitForSync"), v8::Boolean::New(cic.waitForSync(shardID))); result->Set(v8::String::New("journalSize"), v8::Number::New(cic.journalSize(shardID))); const std::string serverID = cic.responsibleServer(shardID); - result->Set(v8::String::New("responsibleServer"), - v8::String::New(serverID.c_str(), serverID.size())); + result->Set(v8::String::New("DBServer"), v8::String::New(serverID.c_str(), serverID.size())); // TODO: fill "indexes" v8::Handle indexes = v8::Array::New(); diff --git a/js/server/modules/org/arangodb/cluster.js b/js/server/modules/org/arangodb/cluster.js index 5165213055..23439501f4 100644 --- a/js/server/modules/org/arangodb/cluster.js +++ b/js/server/modules/org/arangodb/cluster.js @@ -248,6 +248,9 @@ function createLocalDatabases (plannedDatabases) { try { db._createDatabase(payload.name); + payload.error = false; + payload.errorNum = 0; + payload.errorMessage = "no error"; } catch (err) { payload.error = true; @@ -426,7 +429,7 @@ function createLocalCollections (plannedCollections) { payload.errorMessage = err2.errorMessage; } - payload.DBserver = ourselves; + payload.DBServer = ourselves; writeLocked({ part: "Current" }, createCollectionAgency, [ database, shard, payload ]); @@ -449,6 +452,10 @@ function createLocalCollections (plannedCollections) { shard); db._collection(shard).load(); } + payload.error = false; + payload.errorNum = 0; + payload.errorMessage = "no error"; + payload.DBServer = ourselves; writeLocked({ part: "Current" }, createCollectionAgency, @@ -483,7 +490,7 @@ function createLocalCollections (plannedCollections) { payload.errorMessage = err3.errorMessage; } - payload.DBserver = ourselves; + payload.DBServer = ourselves; writeLocked({ part: "Current" }, createCollectionAgency, [ database, shard, payload ]); @@ -608,12 +615,14 @@ function cleanupCurrentCollections (plannedCollections) { if (collections.hasOwnProperty(collection)) { var shards = collections[collection]; var shard; - + for (shard in shards) { if (shards.hasOwnProperty(shard)) { - if (! shardMap.hasOwnProperty(shard) || - shardMap[shard] !== ourselves) { - + + if (shards[shard].DBServer === ourselves && + (! shardMap.hasOwnProperty(shard) || + shardMap[shard] !== ourselves)) { + // found a shard we are entered for but that we don't have locally console.info("cleaning up entry for unknown shard '%s' of '%s/%s", shard, database, From 6a2563ffd4fb799c324ae827c14cfb1abf79782f Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Thu, 23 Jan 2014 12:13:30 +0100 Subject: [PATCH 2/4] bugfix for getResponsibleServer --- arangod/Cluster/ClusterInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arangod/Cluster/ClusterInfo.cpp b/arangod/Cluster/ClusterInfo.cpp index 16b8c50505..1c22e1baf8 100644 --- a/arangod/Cluster/ClusterInfo.cpp +++ b/arangod/Cluster/ClusterInfo.cpp @@ -807,7 +807,7 @@ void ClusterInfo::loadCurrentCollections (bool acquireLock) { // Now take note of this shard and its responsible server: std::string DBserver = triagens::basics::JsonHelper::getStringValue - (json, "DBserver", ""); + (json, "DBServer", ""); if (DBserver != "") { _shardIds.insert(make_pair(shardID, DBserver)); } From 165d98578a55e1264e9f0f8890769469e69a0ef2 Mon Sep 17 00:00:00 2001 From: Max Neunhoeffer Date: Thu, 23 Jan 2014 13:00:44 +0100 Subject: [PATCH 3/4] First hack at create document via REST on cluster. --- arangod/RestHandler/RestDocumentHandler.cpp | 47 +++++++++++++++++-- .../RestHandler/RestVocbaseBaseHandler.cpp | 7 +++ init-cluster.sh | 2 - .../aardvark/frontend/js/bootstrap/errors.js | 1 + js/common/bootstrap/errors.js | 1 + lib/BasicsC/errors.dat | 1 + lib/BasicsC/string-buffer.c | 2 +- lib/BasicsC/voc-errors.c | 1 + lib/BasicsC/voc-errors.h | 14 ++++++ 9 files changed, 70 insertions(+), 6 deletions(-) diff --git a/arangod/RestHandler/RestDocumentHandler.cpp b/arangod/RestHandler/RestDocumentHandler.cpp index 0987a15856..4e8db84c51 100644 --- a/arangod/RestHandler/RestDocumentHandler.cpp +++ b/arangod/RestHandler/RestDocumentHandler.cpp @@ -325,6 +325,7 @@ bool RestDocumentHandler::createDocument () { #ifdef TRI_ENABLE_CLUSTER if (ServerState::instance()->isCoordinator()) { + // json will be freed inside! return createDocumentCoordinator(collection, waitForSync, json); } #endif @@ -404,9 +405,49 @@ bool RestDocumentHandler::createDocument () { bool RestDocumentHandler::createDocumentCoordinator (char const* collection, bool waitForSync, TRI_json_t* json) { - // Find collectionID from collection, which is the name - // ask ClusterInfo for the responsible shard - // send a synchronous request to that shard using ClusterComm + // Set a few variables needed for our work: + ClusterInfo* ci = ClusterInfo::instance(); + ClusterComm* cc = ClusterComm::instance(); + string const& dbname = _request->originalDatabaseName(); + CollectionID const collname(collection); + string collid; + + // First determine the collection ID from the name: + CollectionInfo collinfo = ci->getCollection(dbname, collname); + collid = collinfo.id(); + + // Now find the responsible shard: + ShardID shardID = ci->getResponsibleShard( collid, json, true ); + if (shardID == "") { + TRI_FreeJson(TRI_UNKNOWN_MEM_ZONE, json); + generateTransactionError(collection, TRI_ERROR_SHARD_GONE); + return false; + } + + // Now sort out the _key attribute: + // FIXME: we have to be cleverer here, depending on shard attributes + uint64_t uid = ci->uniqid(); + string _key = triagens::basics::StringUtils::itoa(uid); + TRI_InsertArrayJson(TRI_UNKNOWN_MEM_ZONE, json, "_key", + TRI_CreateStringReference2Json(TRI_UNKNOWN_MEM_ZONE, + _key.c_str(), _key.size())); + + string body = JsonHelper::toString(json); + TRI_FreeJson(TRI_UNKNOWN_MEM_ZONE, json); + + // Send a synchronous request to that shard using ClusterComm: + ClusterCommResult* res; + map headers; + res = cc->syncRequest("", TRI_NewTickServer(), "shard:"+shardID, + triagens::rest::HttpRequest::HTTP_REQUEST_POST, + "/_db/"+dbname+"/_api/document?collection="+ + StringUtils::urlEncode(collname)+"&waitForSync="+ + (waitForSync ? "true" : "false"), + body.c_str(), body.size(), headers, 0.0); + + if (res->status != CL_COMM_SENT) { + + } // if not successful prepare error and return false // prepare successful answer (created or accepted depending on waitForSync) return true; diff --git a/arangod/RestHandler/RestVocbaseBaseHandler.cpp b/arangod/RestHandler/RestVocbaseBaseHandler.cpp index 8d4d59b017..91e59ffd74 100644 --- a/arangod/RestHandler/RestVocbaseBaseHandler.cpp +++ b/arangod/RestHandler/RestVocbaseBaseHandler.cpp @@ -437,6 +437,13 @@ void RestVocbaseBaseHandler::generateTransactionError (const string& collectionN generatePreconditionFailed(_resolver.getCollectionId(collectionName), key ? key : (TRI_voc_key_t) "unknown", rid); return; +#ifdef TRI_ENABLE_CLUSTER + case TRI_ERROR_SHARD_GONE: + generateError(HttpResponse::SERVER_ERROR, res, + "coordinator: no responsible shard found"); + return; +#endif + default: generateError(HttpResponse::SERVER_ERROR, TRI_ERROR_INTERNAL, "failed with error: " + string(TRI_errno_string(res))); } diff --git a/init-cluster.sh b/init-cluster.sh index b0e13c2e8e..2000b4a2b9 100755 --- a/init-cluster.sh +++ b/init-cluster.sh @@ -25,5 +25,3 @@ echo start arangod with: echo "Pavel: bin/arangod --cluster.my-id Pavel --cluster.agency-prefix $NAME --cluster.agency-endpoint tcp://127.0.0.1:4001 --server.endpoint tcp://127.0.0.1:8530 data-pavel" echo "Perry: bin/arangod --cluster.my-id Perry --cluster.agency-prefix $NAME --cluster.agency-endpoint tcp://127.0.0.1:4001 --server.endpoint tcp://127.0.0.1:8531 data-perry" echo "Claus: bin/arangod --cluster.my-id Claus --cluster.agency-prefix $NAME --cluster.agency-endpoint tcp://127.0.0.1:4001 --server.endpoint tcp://127.0.0.1:8529 data-claus" -echo test with: -echo curl -X GET http://localhost:8529/_admin/sharding-test/_admin/time diff --git a/js/apps/system/aardvark/frontend/js/bootstrap/errors.js b/js/apps/system/aardvark/frontend/js/bootstrap/errors.js index ce720002f0..72ab9a602e 100644 --- a/js/apps/system/aardvark/frontend/js/bootstrap/errors.js +++ b/js/apps/system/aardvark/frontend/js/bootstrap/errors.js @@ -125,6 +125,7 @@ "ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE" : { "code" : 1462, "message" : "could not create database" }, "ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_PLAN" : { "code" : 1463, "message" : "could not remove database from plan" }, "ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_CURRENT" : { "code" : 1464, "message" : "could not remove database from current" }, + "ERROR_SHARD_GONE" : { "code" : 1465, "message" : "no responsible shard found" }, "ERROR_QUERY_KILLED" : { "code" : 1500, "message" : "query killed" }, "ERROR_QUERY_PARSE" : { "code" : 1501, "message" : "%s" }, "ERROR_QUERY_EMPTY" : { "code" : 1502, "message" : "query is empty" }, diff --git a/js/common/bootstrap/errors.js b/js/common/bootstrap/errors.js index ce720002f0..72ab9a602e 100644 --- a/js/common/bootstrap/errors.js +++ b/js/common/bootstrap/errors.js @@ -125,6 +125,7 @@ "ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE" : { "code" : 1462, "message" : "could not create database" }, "ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_PLAN" : { "code" : 1463, "message" : "could not remove database from plan" }, "ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_CURRENT" : { "code" : 1464, "message" : "could not remove database from current" }, + "ERROR_SHARD_GONE" : { "code" : 1465, "message" : "no responsible shard found" }, "ERROR_QUERY_KILLED" : { "code" : 1500, "message" : "query killed" }, "ERROR_QUERY_PARSE" : { "code" : 1501, "message" : "%s" }, "ERROR_QUERY_EMPTY" : { "code" : 1502, "message" : "query is empty" }, diff --git a/lib/BasicsC/errors.dat b/lib/BasicsC/errors.dat index 19f84543e3..90886009da 100755 --- a/lib/BasicsC/errors.dat +++ b/lib/BasicsC/errors.dat @@ -160,6 +160,7 @@ ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE_IN_PLAN,1461,"could not create database ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE,1462,"could not create database","Will be raised when a coordinator in a cluster notices that some DBServers report problems when creating databases for a new cluster wide database." ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_PLAN,1463,"could not remove database from plan","Will be raised when a coordinator in a cluster cannot remove an entry for a database in the Plan hierarchy in the agency." ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_CURRENT,1464,"could not remove database from current","Will be raised when a coordinator in a cluster cannot remove an entry for a database in the Current hierarchy in the agency." +ERROR_SHARD_GONE,1465,"no responsible shard found","Will be raised when a coordinator in a cluster cannot determine the shard that is responsible for a given document." ################################################################################ ## ArangoDB query errors diff --git a/lib/BasicsC/string-buffer.c b/lib/BasicsC/string-buffer.c index f9b01afb87..16d7756316 100644 --- a/lib/BasicsC/string-buffer.c +++ b/lib/BasicsC/string-buffer.c @@ -203,7 +203,7 @@ void TRI_DestroyStringBuffer (TRI_string_buffer_t * self) { //////////////////////////////////////////////////////////////////////////////// /// @brief frees the string buffer and cleans the buffer /// -/// @warning You must call free after or destroy using the string buffer. +/// @warning You must call free or destroy after using the string buffer. //////////////////////////////////////////////////////////////////////////////// void TRI_AnnihilateStringBuffer (TRI_string_buffer_t * self) { diff --git a/lib/BasicsC/voc-errors.c b/lib/BasicsC/voc-errors.c index 5bdce5bdc3..3cd5d98702 100644 --- a/lib/BasicsC/voc-errors.c +++ b/lib/BasicsC/voc-errors.c @@ -121,6 +121,7 @@ void TRI_InitialiseErrorMessages (void) { REG_ERROR(ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE, "could not create database"); REG_ERROR(ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_PLAN, "could not remove database from plan"); REG_ERROR(ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_CURRENT, "could not remove database from current"); + REG_ERROR(ERROR_SHARD_GONE, "no responsible shard found"); REG_ERROR(ERROR_QUERY_KILLED, "query killed"); REG_ERROR(ERROR_QUERY_PARSE, "%s"); REG_ERROR(ERROR_QUERY_EMPTY, "query is empty"); diff --git a/lib/BasicsC/voc-errors.h b/lib/BasicsC/voc-errors.h index bdc4904b4a..b8b376cdd3 100644 --- a/lib/BasicsC/voc-errors.h +++ b/lib/BasicsC/voc-errors.h @@ -280,6 +280,9 @@ extern "C" { /// - 1464: @LIT{could not remove database from current} /// Will be raised when a coordinator in a cluster cannot remove an entry for /// a database in the Current hierarchy in the agency. +/// - 1465: @LIT{no responsible shard found} +/// Will be raised when a coordinator in a cluster cannot determine the shard +/// that is responsible for a given document. /// - 1500: @LIT{query killed} /// Will be raised when a running query is killed by an explicit admin /// command. @@ -1624,6 +1627,17 @@ void TRI_InitialiseErrorMessages (void); #define TRI_ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_CURRENT (1464) +//////////////////////////////////////////////////////////////////////////////// +/// @brief 1465: ERROR_SHARD_GONE +/// +/// no responsible shard found +/// +/// Will be raised when a coordinator in a cluster cannot determine the shard +/// that is responsible for a given document. +//////////////////////////////////////////////////////////////////////////////// + +#define TRI_ERROR_SHARD_GONE (1465) + //////////////////////////////////////////////////////////////////////////////// /// @brief 1500: ERROR_QUERY_KILLED /// From 9230f5020cc5d1b8bc88f524d9f322b18f136711 Mon Sep 17 00:00:00 2001 From: Max Neunhoeffer Date: Thu, 23 Jan 2014 16:16:06 +0100 Subject: [PATCH 4/4] First case of create document is working on cluster. --- arangod/Cluster/ClusterInfo.cpp | 4 +- arangod/RestHandler/RestDocumentHandler.cpp | 40 ++++++++++++++----- .../RestHandler/RestVocbaseBaseHandler.cpp | 3 ++ .../aardvark/frontend/js/bootstrap/errors.js | 1 + js/common/bootstrap/errors.js | 1 + lib/BasicsC/errors.dat | 1 + lib/BasicsC/voc-errors.c | 1 + lib/BasicsC/voc-errors.h | 14 +++++++ 8 files changed, 54 insertions(+), 11 deletions(-) diff --git a/arangod/Cluster/ClusterInfo.cpp b/arangod/Cluster/ClusterInfo.cpp index 1c22e1baf8..cb177ac391 100644 --- a/arangod/Cluster/ClusterInfo.cpp +++ b/arangod/Cluster/ClusterInfo.cpp @@ -1578,7 +1578,6 @@ ShardID ClusterInfo::getResponsibleShard (CollectionID const& collectionID, int tries = 0; TRI_shared_ptr > shardKeysPtr; char const** shardKeys = 0; - int nrShardKeys = 0; TRI_shared_ptr > shards; while (++tries <= 2) { @@ -1610,7 +1609,8 @@ ShardID ClusterInfo::getResponsibleShard (CollectionID const& collectionID, return string(""); } - uint64_t hash = TRI_HashJsonByAttributes(json, shardKeys, nrShardKeys); + uint64_t hash = TRI_HashJsonByAttributes(json, shardKeys, + shardKeysPtr->size()); delete[] shardKeys; return shards->at(hash % shards->size()); diff --git a/arangod/RestHandler/RestDocumentHandler.cpp b/arangod/RestHandler/RestDocumentHandler.cpp index 4e8db84c51..01607ed916 100644 --- a/arangod/RestHandler/RestDocumentHandler.cpp +++ b/arangod/RestHandler/RestDocumentHandler.cpp @@ -410,11 +410,10 @@ bool RestDocumentHandler::createDocumentCoordinator (char const* collection, ClusterComm* cc = ClusterComm::instance(); string const& dbname = _request->originalDatabaseName(); CollectionID const collname(collection); - string collid; // First determine the collection ID from the name: CollectionInfo collinfo = ci->getCollection(dbname, collname); - collid = collinfo.id(); + string collid = StringUtils::itoa(collinfo.id()); // Now find the responsible shard: ShardID shardID = ci->getResponsibleShard( collid, json, true ); @@ -441,16 +440,39 @@ bool RestDocumentHandler::createDocumentCoordinator (char const* collection, res = cc->syncRequest("", TRI_NewTickServer(), "shard:"+shardID, triagens::rest::HttpRequest::HTTP_REQUEST_POST, "/_db/"+dbname+"/_api/document?collection="+ - StringUtils::urlEncode(collname)+"&waitForSync="+ + StringUtils::urlEncode(shardID)+"&waitForSync="+ (waitForSync ? "true" : "false"), - body.c_str(), body.size(), headers, 0.0); + body.c_str(), body.size(), headers, 60.0); - if (res->status != CL_COMM_SENT) { - + if (res->status == CL_COMM_TIMEOUT) { + // No reply, we give up: + generateTransactionError(collection, TRI_ERROR_CLUSTER_TIMEOUT); + return false; } - // if not successful prepare error and return false - // prepare successful answer (created or accepted depending on waitForSync) - return true; + bool resultflag = true; + if (res->status == CL_COMM_ERROR) { + // This could be a broken connection or an Http error: + if (!res->result->isComplete()) { + generateTransactionError(collection, TRI_ERROR_CLUSTER_CONNECTION_LOST); + return false; + } + // In this case a proper HTTP error was reported by the DBserver, + // this can be 400 or 404, we simply forward the result. + resultflag = false; + // We intentionally fall through here. + } + _response = createResponse( + static_cast + (res->result->getHttpReturnCode())); + //cout << "CreateDoc: result code: " << res->result->getHttpReturnCode() + // << endl; + _response->setContentType(res->result->getContentType(false)); + //cout << "CreateDoc: contentType: " << res->result->getContentType(false) + // << endl; + body = res->result->getBody().str(); // FIXME: a bad unnecessary copy! + //cout << "CreateDoc: body" << endl << body << endl; + //_response->body().appendText(body.c_str(), body.size()); + return resultflag; } #endif diff --git a/arangod/RestHandler/RestVocbaseBaseHandler.cpp b/arangod/RestHandler/RestVocbaseBaseHandler.cpp index 91e59ffd74..12bcc2259f 100644 --- a/arangod/RestHandler/RestVocbaseBaseHandler.cpp +++ b/arangod/RestHandler/RestVocbaseBaseHandler.cpp @@ -442,6 +442,9 @@ void RestVocbaseBaseHandler::generateTransactionError (const string& collectionN generateError(HttpResponse::SERVER_ERROR, res, "coordinator: no responsible shard found"); return; + case TRI_ERROR_CLUSTER_TIMEOUT: + generateError(HttpResponse::SERVER_ERROR, res); + return; #endif default: diff --git a/js/apps/system/aardvark/frontend/js/bootstrap/errors.js b/js/apps/system/aardvark/frontend/js/bootstrap/errors.js index 72ab9a602e..13bfb1bc08 100644 --- a/js/apps/system/aardvark/frontend/js/bootstrap/errors.js +++ b/js/apps/system/aardvark/frontend/js/bootstrap/errors.js @@ -126,6 +126,7 @@ "ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_PLAN" : { "code" : 1463, "message" : "could not remove database from plan" }, "ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_CURRENT" : { "code" : 1464, "message" : "could not remove database from current" }, "ERROR_SHARD_GONE" : { "code" : 1465, "message" : "no responsible shard found" }, + "ERROR_CLUSTER_CONNECTION_LOST" : { "code" : 1466, "message" : "cluster internal HTTP connection broken" }, "ERROR_QUERY_KILLED" : { "code" : 1500, "message" : "query killed" }, "ERROR_QUERY_PARSE" : { "code" : 1501, "message" : "%s" }, "ERROR_QUERY_EMPTY" : { "code" : 1502, "message" : "query is empty" }, diff --git a/js/common/bootstrap/errors.js b/js/common/bootstrap/errors.js index 72ab9a602e..13bfb1bc08 100644 --- a/js/common/bootstrap/errors.js +++ b/js/common/bootstrap/errors.js @@ -126,6 +126,7 @@ "ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_PLAN" : { "code" : 1463, "message" : "could not remove database from plan" }, "ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_CURRENT" : { "code" : 1464, "message" : "could not remove database from current" }, "ERROR_SHARD_GONE" : { "code" : 1465, "message" : "no responsible shard found" }, + "ERROR_CLUSTER_CONNECTION_LOST" : { "code" : 1466, "message" : "cluster internal HTTP connection broken" }, "ERROR_QUERY_KILLED" : { "code" : 1500, "message" : "query killed" }, "ERROR_QUERY_PARSE" : { "code" : 1501, "message" : "%s" }, "ERROR_QUERY_EMPTY" : { "code" : 1502, "message" : "query is empty" }, diff --git a/lib/BasicsC/errors.dat b/lib/BasicsC/errors.dat index 90886009da..ffb0cfd328 100755 --- a/lib/BasicsC/errors.dat +++ b/lib/BasicsC/errors.dat @@ -161,6 +161,7 @@ ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE,1462,"could not create database","Will b ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_PLAN,1463,"could not remove database from plan","Will be raised when a coordinator in a cluster cannot remove an entry for a database in the Plan hierarchy in the agency." ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_CURRENT,1464,"could not remove database from current","Will be raised when a coordinator in a cluster cannot remove an entry for a database in the Current hierarchy in the agency." ERROR_SHARD_GONE,1465,"no responsible shard found","Will be raised when a coordinator in a cluster cannot determine the shard that is responsible for a given document." +ERROR_CLUSTER_CONNECTION_LOST,1466,"cluster internal HTTP connection broken","Will be raised when a coordinator in a cluster loses an HTTP connection to a DBserver in the cluster whilst transferring data." ################################################################################ ## ArangoDB query errors diff --git a/lib/BasicsC/voc-errors.c b/lib/BasicsC/voc-errors.c index 3cd5d98702..e222032a06 100644 --- a/lib/BasicsC/voc-errors.c +++ b/lib/BasicsC/voc-errors.c @@ -122,6 +122,7 @@ void TRI_InitialiseErrorMessages (void) { REG_ERROR(ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_PLAN, "could not remove database from plan"); REG_ERROR(ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_CURRENT, "could not remove database from current"); REG_ERROR(ERROR_SHARD_GONE, "no responsible shard found"); + REG_ERROR(ERROR_CLUSTER_CONNECTION_LOST, "cluster internal HTTP connection broken"); REG_ERROR(ERROR_QUERY_KILLED, "query killed"); REG_ERROR(ERROR_QUERY_PARSE, "%s"); REG_ERROR(ERROR_QUERY_EMPTY, "query is empty"); diff --git a/lib/BasicsC/voc-errors.h b/lib/BasicsC/voc-errors.h index b8b376cdd3..4793b1903c 100644 --- a/lib/BasicsC/voc-errors.h +++ b/lib/BasicsC/voc-errors.h @@ -283,6 +283,9 @@ extern "C" { /// - 1465: @LIT{no responsible shard found} /// Will be raised when a coordinator in a cluster cannot determine the shard /// that is responsible for a given document. +/// - 1466: @LIT{cluster internal HTTP connection broken} +/// Will be raised when a coordinator in a cluster loses an HTTP connection +/// to a DBserver in the cluster whilst transferring data. /// - 1500: @LIT{query killed} /// Will be raised when a running query is killed by an explicit admin /// command. @@ -1638,6 +1641,17 @@ void TRI_InitialiseErrorMessages (void); #define TRI_ERROR_SHARD_GONE (1465) +//////////////////////////////////////////////////////////////////////////////// +/// @brief 1466: ERROR_CLUSTER_CONNECTION_LOST +/// +/// cluster internal HTTP connection broken +/// +/// Will be raised when a coordinator in a cluster loses an HTTP connection to +/// a DBserver in the cluster whilst transferring data. +//////////////////////////////////////////////////////////////////////////////// + +#define TRI_ERROR_CLUSTER_CONNECTION_LOST (1466) + //////////////////////////////////////////////////////////////////////////////// /// @brief 1500: ERROR_QUERY_KILLED ///