1
0
Fork 0

switch default message for requireFromPresent (#7439)

This commit is contained in:
Simon 2018-11-23 18:59:03 +01:00 committed by Jan
parent 3322cc5ae2
commit f90b48f792
6 changed files with 32 additions and 25 deletions

View File

@ -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;

View File

@ -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<Syncer::JobSynchronizer>
_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...

View File

@ -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;

View File

@ -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

View File

@ -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,

View File

@ -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;