diff --git a/arangod/Replication/ReplicationApplierConfiguration.cpp b/arangod/Replication/ReplicationApplierConfiguration.cpp index 903177c15d..1003f8a862 100644 --- a/arangod/Replication/ReplicationApplierConfiguration.cpp +++ b/arangod/Replication/ReplicationApplierConfiguration.cpp @@ -59,7 +59,7 @@ ReplicationApplierConfiguration::ReplicationApplierConfiguration() _adaptivePolling(true), _autoResync(false), _includeSystem(true), - _requireFromPresent(false), + _requireFromPresent(true), _incremental(false), _verbose(false), _restrictType(RestrictType::None), @@ -90,7 +90,7 @@ void ReplicationApplierConfiguration::reset() { _adaptivePolling = true; _autoResync = false; _includeSystem = true; - _requireFromPresent = false; + _requireFromPresent = true; _incremental = false; _verbose = false; _restrictType = RestrictType::None; diff --git a/arangod/Replication/TailingSyncer.cpp b/arangod/Replication/TailingSyncer.cpp index 72cca4c510..4a82ad19af 100644 --- a/arangod/Replication/TailingSyncer.cpp +++ b/arangod/Replication/TailingSyncer.cpp @@ -1604,17 +1604,18 @@ Result TailingSyncer::fetchOpenTransactions(TRI_voc_tick_t fromTick, TRI_voc_tick_t readTick = StringUtils::uint64(header); - if (!fromIncluded && _requireFromPresent && fromTick > 0 && - (!_state.master.simulate32Client() || fromTick != readTick)) { - return Result( - TRI_ERROR_REPLICATION_START_TICK_NOT_PRESENT, - std::string("required init tick value '") + - StringUtils::itoa(fromTick) + - "' is not present (anymore?) on master at " + - _state.master.endpoint + ". Last tick available on master is '" + - StringUtils::itoa(readTick) + - "'. It may be required to do a full resync and increase the number " - "of historic logfiles/WAL file timeout on the master."); + if (!fromIncluded && fromTick > 0 && (!_state.master.simulate32Client() || fromTick != readTick)) { + const std::string msg = std::string("required init tick value '") + + StringUtils::itoa(fromTick) + + "' is not present (anymore?) on master at " + + _state.master.endpoint + ". Last tick available on master is '" + + StringUtils::itoa(readTick) + + "'. It may be required to do a full resync and increase the number " + "of historic logfiles/WAL file timeout on the master."; + if (_requireFromPresent) { // hard fail + return Result(TRI_ERROR_REPLICATION_START_TICK_NOT_PRESENT, msg); + } + LOG_TOPIC(WARN, Logger::REPLICATION) << msg; } startTick = readTick; @@ -1838,18 +1839,20 @@ Result TailingSyncer::processMasterLog(std::shared_ptr _applier->_state._lastAvailableContinuousTick = tick; } - if (!fromIncluded && _requireFromPresent && fetchTick > 0 && - (!_state.master.simulate32Client() || originalFetchTick != tick)) { - return Result(TRI_ERROR_REPLICATION_START_TICK_NOT_PRESENT, - std::string("required follow tick value '") + - StringUtils::itoa(fetchTick) + - "' is not present (anymore?) on master at " + - _state.master.endpoint + - ". Last tick available on master is '" + - StringUtils::itoa(tick) + - "'. It may be required to do a full resync and increase " - "the number " + - "of historic logfiles/WAL file timeout on the master"); + if (!fromIncluded && fetchTick > 0 && (!_state.master.simulate32Client() || originalFetchTick != tick)) { + const std::string msg = std::string("required follow tick value '") + + StringUtils::itoa(fetchTick) + + "' is not present (anymore?) on master at " + + _state.master.endpoint + + ". Last tick available on master is '" + + StringUtils::itoa(tick) + + "'. It may be required to do a full resync and increase " + "the number " + + "of historic logfiles/WAL file timeout on the master"; + if (_requireFromPresent) { // hard fail + return Result(TRI_ERROR_REPLICATION_START_TICK_NOT_PRESENT, msg); + } + LOG_TOPIC(WARN, Logger::REPLICATION) << msg; } // already fetch next batch of data in the background... diff --git a/tests/js/server/replication/replication-ongoing-32.js b/tests/js/server/replication/replication-ongoing-32.js index f7e15a7544..4f88b8b588 100644 --- a/tests/js/server/replication/replication-ongoing-32.js +++ b/tests/js/server/replication/replication-ongoing-32.js @@ -95,6 +95,7 @@ const compare = function (masterFunc, masterFunc2, slaveFuncOngoing, slaveFuncFi applierConfiguration.username = 'root'; applierConfiguration.password = ''; applierConfiguration.force32mode = true; + applierConfiguration.requireFromPresent = false; if (!applierConfiguration.hasOwnProperty('chunkSize')) { applierConfiguration.chunkSize = 16384; diff --git a/tests/js/server/replication/replication-ongoing-global-spec.js b/tests/js/server/replication/replication-ongoing-global-spec.js index 64fd317253..a5d39b78d3 100644 --- a/tests/js/server/replication/replication-ongoing-global-spec.js +++ b/tests/js/server/replication/replication-ongoing-global-spec.js @@ -53,6 +53,7 @@ const config = { username: username, password: password, verbose: true, + requireFromPresent: false }; // We allow the replication a delay of this many seconds at most diff --git a/tests/js/server/replication/replication-ongoing-global.js b/tests/js/server/replication/replication-ongoing-global.js index e78396277a..e49653fac6 100644 --- a/tests/js/server/replication/replication-ongoing-global.js +++ b/tests/js/server/replication/replication-ongoing-global.js @@ -83,6 +83,7 @@ const compare = function (masterFunc, masterFunc2, slaveFuncOngoing, slaveFuncFi applierConfiguration.password = ''; applierConfiguration.includeSystem = false; applierConfiguration.force32mode = false; + applierConfiguration.requireFromPresent = false; var syncResult = replication.syncGlobal({ endpoint: masterEndpoint, diff --git a/tests/js/server/replication/replication-ongoing.js b/tests/js/server/replication/replication-ongoing.js index 5d9a8e6444..d30cfa1b7a 100644 --- a/tests/js/server/replication/replication-ongoing.js +++ b/tests/js/server/replication/replication-ongoing.js @@ -98,6 +98,7 @@ const compare = function (masterFunc, masterFunc2, slaveFuncOngoing, slaveFuncFi applierConfiguration.username = 'root'; applierConfiguration.password = ''; applierConfiguration.force32mode = false; + applierConfiguration.requireFromPresent = false; if (!applierConfiguration.hasOwnProperty('chunkSize')) { applierConfiguration.chunkSize = 16384;