From 02a793f5aedb768a195f0bbabafa59e8007861d5 Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Thu, 14 Nov 2013 00:55:36 +0100 Subject: [PATCH] improve error messages on startup --- arangod/VocBase/server.c | 2 +- arangod/VocBase/vocbase.c | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/arangod/VocBase/server.c b/arangod/VocBase/server.c index 06a02ee5bf..d71e46300d 100644 --- a/arangod/VocBase/server.c +++ b/arangod/VocBase/server.c @@ -821,7 +821,7 @@ static int OpenDatabases (TRI_server_t* server) { // grab last error res = TRI_errno(); - if (res != TRI_ERROR_NO_ERROR) { + if (res == TRI_ERROR_NO_ERROR) { // but we must have an error... res = TRI_ERROR_INTERNAL; } diff --git a/arangod/VocBase/vocbase.c b/arangod/VocBase/vocbase.c index 99aea27c34..c4ba7b9087 100644 --- a/arangod/VocBase/vocbase.c +++ b/arangod/VocBase/vocbase.c @@ -562,6 +562,9 @@ static TRI_vocbase_col_t* AddCollection (TRI_vocbase_t* vocbase, if (found != NULL) { LOG_ERROR("duplicate entry for collection name '%s'", name); + LOG_ERROR("collection id %llu has same name as already added collection %llu", + (unsigned long long) cid, + (unsigned long long) ((TRI_vocbase_col_t*) found)->_cid); TRI_Free(TRI_UNKNOWN_MEM_ZONE, collection); TRI_set_errno(TRI_ERROR_ARANGO_DUPLICATE_NAME); @@ -981,12 +984,6 @@ static int ScanPath (TRI_vocbase_t* vocbase, c = AddCollection(vocbase, type, info._name, info._cid, file); - if (iterateMarkers) { - // iterating markers may be time-consuming. we'll only do it if - // we have to - TRI_IterateTicksCollection(file, StartupTickIterator, NULL); - } - if (c == NULL) { LOG_ERROR("failed to add document collection from '%s'", file); @@ -999,6 +996,12 @@ static int ScanPath (TRI_vocbase_t* vocbase, } c->_status = TRI_VOC_COL_STATUS_UNLOADED; + + if (iterateMarkers) { + // iterating markers may be time-consuming. we'll only do it if + // we have to + TRI_IterateTicksCollection(file, StartupTickIterator, NULL); + } LOG_DEBUG("added document collection from '%s'", file); }