1
0
Fork 0

Merge branch 'devel' of https://github.com/triAGENS/ArangoDB into devel

This commit is contained in:
Heiko Kernbach 2013-08-01 13:22:09 +02:00
commit 40e1f9991d
6 changed files with 47 additions and 13 deletions

View File

@ -0,0 +1,5 @@
#!/bin/sh
test -d logs || mkdir logs
rspec --color --format d \
api-replication-spec.rb

View File

@ -560,9 +560,9 @@ unittests-import:
### starts two servers (master & slave) and checks for data drift
################################################################################
.PHONY: unittests-replication unittests-replication-data unittests-replication-logger
.PHONY: unittests-replication unittests-replication-common unittests-replication-http unittests-replication-data unittests-replication-logger
unittests-replication: unittests-replication-common unittests-replication-data unittests-replication-logger
unittests-replication: unittests-replication-common unittests-replication-data unittests-replication-http unittests-replication-logger
unittests-replication-common:
@echo
@ -579,6 +579,25 @@ unittests-replication-common:
@rm -rf "$(VOCDIR)"
@echo
unittests-replication-http:
$(MAKE) start-server PID=$(PID) SERVER_START="--server.endpoint tcp://$(VOCHOST):$(VOCPORT) --server.disable-authentication true" PROTO=http
@echo
@echo "================================================================================"
@echo "<< REPLICATION SERVER TESTS >>"
@echo "================================================================================"
@echo
cd @top_srcdir@/UnitTests/HttpInterface && ARANGO_SERVER="$(VOCHOST):$(VOCPORT)" ARANGO_SSL=0 ARANGO_USER="$(USERNAME)" ARANGO_PASSWORD="$(PASSWORD)" ./run-tests-replication || test "x$(FORCE)" == "x1"
kill `cat $(PIDFILE)`
while test -f $(PIDFILE); do sleep 1; done
@if [ "$(VALGRIND)" != "" ]; then sleep 60; fi
@rm -rf "$(VOCDIR)"
@echo
unittests-replication-data:
$(MAKE) start-server PID=$(PID) SERVER_START="--server.endpoint tcp://$(VOCHOST):$(VOCPORT) --server.disable-authentication true" PROTO=http
$(MAKE) start-slave PID=$(PID) SERVER_START="--server.endpoint tcp://$(SLAVEHOST):$(SLAVEPORT) --server.disable-authentication true" PROTO=http

View File

@ -79,6 +79,7 @@
#include "V8/v8-utils.h"
#include "V8Server/ApplicationV8.h"
#include "VocBase/auth.h"
#include "VocBase/replication-common.h"
#include "RestServer/VocbaseManager.h"
@ -204,7 +205,7 @@ ArangoServer::ArangoServer (int argc, char** argv)
_removeOnDrop(true),
_replicationEnableLogger(false),
_replicationLogRemoteChanges(false),
_replicationMaxEvents(1048576),
_replicationMaxEvents(TRI_REPLICATION_LOGGER_EVENTS_DEFAULT),
_replicationMaxEventsSize(0),
_vocbase(0) {

View File

@ -80,6 +80,12 @@ extern "C" {
#define TRI_REPLICATION_LOGGER_EVENTS_MIN 4096
////////////////////////////////////////////////////////////////////////////////
/// @brief default number of log events to keep
////////////////////////////////////////////////////////////////////////////////
#define TRI_REPLICATION_LOGGER_EVENTS_DEFAULT 1048576
////////////////////////////////////////////////////////////////////////////////
/// @brief minimum cumulated size of log events to keep (lower bound for logger
/// config)

View File

@ -265,9 +265,14 @@ static TRI_replication_operation_e TranslateDocumentOperation (TRI_voc_document_
////////////////////////////////////////////////////////////////////////////////
static void FreeCap (TRI_replication_logger_t* logger) {
assert(logger != NULL);
if (logger->_cap != NULL) {
TRI_primary_collection_t* primary;
assert(logger->_trxCollection != NULL);
assert(logger->_trxCollection->_collection != NULL);
primary = logger->_trxCollection->_collection->_collection;
assert(primary != NULL);
@ -276,8 +281,6 @@ static void FreeCap (TRI_replication_logger_t* logger) {
TRI_GetServerId());
logger->_cap = NULL;
logger->_configuration._maxEvents = 0;
logger->_configuration._maxEventsSize = 0;
}
}
@ -1009,22 +1012,22 @@ static int StopReplicationLogger (TRI_replication_logger_t* logger) {
res = LogEvent(logger, 0, true, REPLICATION_STOP, buffer);
// destroy cap constraint
FreeCap(logger);
TRI_CommitTransaction(logger->_trx, 0);
TRI_FreeTransaction(logger->_trx);
LOG_INFO("stopped replication logger for database '%s', last tick: %llu",
logger->_databaseName,
(unsigned long long) lastTick);
logger->_trx = NULL;
logger->_trxCollection = NULL;
logger->_state._lastLogTick = 0;
logger->_state._active = false;
// destroy cap constraint
FreeCap(logger);
return res;
}

View File

@ -2293,7 +2293,7 @@ function ReplicationApplierSuite () {
fail();
}
catch (err) {
assertEqual(errors.ERROR_REPLICATION_INVALID_CONFIGURATION.code, err.errorNum);
assertEqual(errors.ERROR_REPLICATION_INVALID_APPLIER_CONFIGURATION.code, err.errorNum);
}
},
@ -2373,7 +2373,7 @@ function ReplicationApplierSuite () {
replication.applier.properties({ });
}
catch (err) {
assertEqual(errors.ERROR_REPLICATION_INVALID_CONFIGURATION.code, err.errorNum);
assertEqual(errors.ERROR_REPLICATION_INVALID_APPLIER_CONFIGURATION.code, err.errorNum);
}
replication.applier.properties({