diff --git a/Documentation/Books/Manual/Administration/MasterSlave/DatabaseSetup.md b/Documentation/Books/Manual/Administration/MasterSlave/DatabaseSetup.md index ffcace1aac..9fb216f254 100644 --- a/Documentation/Books/Manual/Administration/MasterSlave/DatabaseSetup.md +++ b/Documentation/Books/Manual/Administration/MasterSlave/DatabaseSetup.md @@ -178,6 +178,13 @@ It is often not necessary to replicate data from system collections, especially lead to confusion on the slave because the slave needs to have its own system collections in order to start and keep operational. +{% hint 'warning' %} +There is a separate option +*includeFoxxQueues* for controlling whether Foxx queue jobs from the system collections `_jobs` +and `_queues` collections should be replicated. Documents from these collections are not replicated +by default in order to avoid execution of Foxx queue jobs on the slave. +{% endhint %} + The *requireFromPresent* attribute controls whether the applier will start synchronizing in case it detects that the master cannot provide data for the initial tick value provided by the slave. This may be the case if the master does not have a big enough backlog of historic WAL logfiles, diff --git a/Documentation/Books/Manual/Administration/MasterSlave/ReplicationApplier.md b/Documentation/Books/Manual/Administration/MasterSlave/ReplicationApplier.md index 9184f60ec1..5938e8c7ba 100644 --- a/Documentation/Books/Manual/Administration/MasterSlave/ReplicationApplier.md +++ b/Documentation/Books/Manual/Administration/MasterSlave/ReplicationApplier.md @@ -177,6 +177,11 @@ otherwise, they will not be replicated. It is often not necessary to replicate d collections, especially because it may lead to confusion on the slave because the slave needs to have its own system collections in order to start and keep operational. +{% hint 'warning' %} +There is a separate option *includeFoxxQueues* for controlling whether Foxx queue jobs from the system +collections `_jobs` and `_queues` collections should be replicated. Documents from these collections +are not replicated by default in order to avoid execution of Foxx queue jobs on the slave. + The *requireFromPresent* attribute controls whether the applier will start synchronizing in case it detects that the master cannot provide data for the initial tick value provided by the slave. This may be the case if the master does not have a big enough backlog of historic WAL logfiles, diff --git a/Documentation/Books/Manual/Administration/MasterSlave/ServerLevelSetup.md b/Documentation/Books/Manual/Administration/MasterSlave/ServerLevelSetup.md index 4d298095a5..dd7366419f 100644 --- a/Documentation/Books/Manual/Administration/MasterSlave/ServerLevelSetup.md +++ b/Documentation/Books/Manual/Administration/MasterSlave/ServerLevelSetup.md @@ -177,6 +177,13 @@ It is often not necessary to replicate data from system collections, especially lead to confusion on the slave because the slave needs to have its own system collections in order to start and keep operational. +{% hint 'warning' %} +There is a separate option +*includeFoxxQueues* for controlling whether Foxx queue jobs from the system collections `_jobs` +and `_queues` collections should be replicated. Documents from these collections are not replicated +by default in order to avoid execution of Foxx queue jobs on the slave. +{% endhint %} + The *requireFromPresent* attribute controls whether the applier will start synchronizing in case it detects that the master cannot provide data for the initial tick value provided by the slave. This may be the case if the master does not have a big enough backlog of historic WAL logfiles, diff --git a/arangod/Replication/DatabaseInitialSyncer.cpp b/arangod/Replication/DatabaseInitialSyncer.cpp index 2391e3fb4c..5199f69552 100644 --- a/arangod/Replication/DatabaseInitialSyncer.cpp +++ b/arangod/Replication/DatabaseInitialSyncer.cpp @@ -1126,10 +1126,9 @@ Result DatabaseInitialSyncer::handleCollection(VPackSlice const& parameters, if (col != nullptr) { bool truncate = false; - if (col->name() == TRI_COL_NAME_USERS) { - // better not throw away the _users collection. otherwise it is gone - // and this may be a problem if the - // server crashes in-between. + if (col->system()) { + // better not throw away system collections. otherwise they may be dropped + // and this can be a problem if the server crashes before they are recreated. truncate = true; } diff --git a/arangod/Replication/GlobalInitialSyncer.cpp b/arangod/Replication/GlobalInitialSyncer.cpp index 14c1a88fba..ce8af1afff 100644 --- a/arangod/Replication/GlobalInitialSyncer.cpp +++ b/arangod/Replication/GlobalInitialSyncer.cpp @@ -202,7 +202,7 @@ Result GlobalInitialSyncer::runInternal(bool incremental) { _state.barrier.updateTime, _batch.id, _batch.updateTime); // run the syncer with the supplied inventory collections - Result r = syncer->runWithInventory(false, dbInventory); + Result r = syncer->runWithInventory(incremental, dbInventory); if (r.fail()) { return r; } @@ -220,7 +220,7 @@ Result GlobalInitialSyncer::runInternal(bool incremental) { return Result(TRI_ERROR_INTERNAL, "caught an unexpected exception"); } - return TRI_ERROR_NO_ERROR; + return Result(); } /// @brief add or remove databases such that the local inventory @@ -342,7 +342,7 @@ Result GlobalInitialSyncer::updateServerInventory(VPackSlice const& masterDataba } } - return TRI_ERROR_NO_ERROR; + return Result(); } /// @brief fetch the server's inventory, public method for TailingSyncer diff --git a/arangod/Replication/ReplicationApplierConfiguration.cpp b/arangod/Replication/ReplicationApplierConfiguration.cpp index 0e5ff6f72f..6339b6cfc5 100644 --- a/arangod/Replication/ReplicationApplierConfiguration.cpp +++ b/arangod/Replication/ReplicationApplierConfiguration.cpp @@ -59,12 +59,11 @@ ReplicationApplierConfiguration::ReplicationApplierConfiguration() _adaptivePolling(true), _autoResync(false), _includeSystem(true), + _includeFoxxQueues(false), _requireFromPresent(true), _incremental(false), _verbose(false), - _restrictType(RestrictType::None), - _restrictCollections(), - _includeFoxxQueues(false) {} + _restrictType(RestrictType::None) {} /// @brief reset the configuration to defaults void ReplicationApplierConfiguration::reset() { @@ -91,12 +90,12 @@ void ReplicationApplierConfiguration::reset() { _adaptivePolling = true; _autoResync = false; _includeSystem = true; + _includeFoxxQueues = false; _requireFromPresent = true; _incremental = false; _verbose = false; _restrictType = RestrictType::None; _restrictCollections.clear(); - _includeFoxxQueues = false; #ifdef ARANGODB_ENABLE_MAINTAINER_MODE _force32mode = false; #endif @@ -140,6 +139,7 @@ void ReplicationApplierConfiguration::toVelocyPack(VPackBuilder& builder, bool i builder.add("autoResyncRetries", VPackValue(_autoResyncRetries)); builder.add("maxPacketSize", VPackValue(_maxPacketSize)); builder.add("includeSystem", VPackValue(_includeSystem)); + builder.add("includeFoxxQueues", VPackValue(_includeFoxxQueues)); builder.add("requireFromPresent", VPackValue(_requireFromPresent)); builder.add("verbose", VPackValue(_verbose)); builder.add("incremental", VPackValue(_incremental)); @@ -271,6 +271,11 @@ ReplicationApplierConfiguration ReplicationApplierConfiguration::fromVelocyPack( if (value.isBoolean()) { configuration._includeSystem = value.getBoolean(); } + + value = slice.get("includeFoxxQueues"); + if (value.isBoolean()) { + configuration._includeFoxxQueues = value.getBoolean(); + } value = slice.get("requireFromPresent"); if (value.isBoolean()) { diff --git a/arangod/Replication/ReplicationApplierConfiguration.h b/arangod/Replication/ReplicationApplierConfiguration.h index 378052e337..0a9875208c 100644 --- a/arangod/Replication/ReplicationApplierConfiguration.h +++ b/arangod/Replication/ReplicationApplierConfiguration.h @@ -60,13 +60,13 @@ class ReplicationApplierConfiguration { bool _adaptivePolling; bool _autoResync; /// resync completely if we miss updates bool _includeSystem; + bool _includeFoxxQueues; /// sync the _jobs and _queues collection bool _requireFromPresent; /// while tailing WAL: master must have the clients /// requested tick bool _incremental; /// use incremental sync if we got local data bool _verbose; RestrictType _restrictType; std::set _restrictCollections; - bool _includeFoxxQueues; /// sync the _jobs collection #ifdef ARANGODB_ENABLE_MAINTAINER_MODE bool _force32mode = false; // force client to act like 3.2 #endif diff --git a/js/server/server.js b/js/server/server.js index c1913357cd..67513d9544 100644 --- a/js/server/server.js +++ b/js/server/server.js @@ -65,7 +65,12 @@ } // start the queue manager once - require('@arangodb/foxx/queues/manager').run(); + try { + require('@arangodb/foxx/queues/manager').run(); + } catch (err) { + require("console").warn("unable to start Foxx queues manager: " + String(err)); + // continue with the startup! + } } // check available versions