From 2c4accdf342dc2b49b4e293cccb9025a003b1e7c Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 19 Mar 2019 12:47:57 +0100 Subject: [PATCH] micro improvements for rocksdb options (#8433) --- CHANGELOG | 9 +++++++++ .../Books/Manual/ReleaseNotes/UpgradingChanges35.md | 6 ++++++ arangod/RocksDBEngine/RocksDBEngine.cpp | 10 +++++++++- lib/ApplicationFeatures/ApplicationServer.h | 3 +++ lib/ApplicationFeatures/RocksDBOptionFeature.cpp | 3 ++- 5 files changed, 29 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 24ac5b5da1..5a476a57ee 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,15 @@ devel ----- +* renamed hidden startup option `--rocksdb.delayed_write_rate` to the more + consistent `--rocksdb.delayed-write-rate`. When the old option name is + used, the arangod startup will be aborted with a descriptive error message. + +* if not explicitly configured, make agency nodes start removing their unused + WAL files a few seconds after the completed server startup already. This is + because on agency nodes, unused WAL files do not need to be retained for + potential replication clients to read them. + * added option `--all-databases` to arangodump and arangorestore When set to true, this makes arangodump dump all available databases diff --git a/Documentation/Books/Manual/ReleaseNotes/UpgradingChanges35.md b/Documentation/Books/Manual/ReleaseNotes/UpgradingChanges35.md index 5628e385e3..c0f6b8e915 100644 --- a/Documentation/Books/Manual/ReleaseNotes/UpgradingChanges35.md +++ b/Documentation/Books/Manual/ReleaseNotes/UpgradingChanges35.md @@ -6,6 +6,12 @@ upgrading to ArangoDB 3.5, and adjust any client programs if necessary. The following incompatible changes have been made in ArangoDB 3.5: +Startup options +--------------- + +The hidden startup option `--rocksdb.delayed_write_rate` was renamed to the more +consistent `--rocksdb.delayed-write-rate`. When the old option name is used, the +arangod startup will be aborted with a descriptive error message. Web interface ------------- diff --git a/arangod/RocksDBEngine/RocksDBEngine.cpp b/arangod/RocksDBEngine/RocksDBEngine.cpp index 1c8972e6b1..35a82d3191 100644 --- a/arangod/RocksDBEngine/RocksDBEngine.cpp +++ b/arangod/RocksDBEngine/RocksDBEngine.cpp @@ -22,6 +22,7 @@ /// @author Jan Christoph Uhde //////////////////////////////////////////////////////////////////////////////// +#include "ApplicationFeatures/ApplicationServer.h" #include "ApplicationFeatures/RocksDBOptionFeature.h" #include "Basics/Exceptions.h" #include "Basics/FileUtils.h" @@ -356,6 +357,13 @@ void RocksDBEngine::start() { if (!isEnabled()) { return; } + + if (ServerState::instance()->isAgent() && + !application_features::ApplicationServer::server->options()->processingResult().touched("rocksdb.wal-file-timeout-initial")) { + // reduce --rocksb.wal-file-timeout-initial to 15 seconds for agency nodes + // as we probably won't need the WAL for WAL tailing and replication here + _pruneWaitTimeInitial = 15; + } LOG_TOPIC(TRACE, arangodb::Logger::ENGINES) << "rocksdb version " << rest::Version::getRocksDBVersion() @@ -2328,4 +2336,4 @@ void RocksDBEngine::releaseTick(TRI_voc_tick_t tick) { // ----------------------------------------------------------------------------- // --SECTION-- END-OF-FILE -// ----------------------------------------------------------------------------- \ No newline at end of file +// ----------------------------------------------------------------------------- diff --git a/lib/ApplicationFeatures/ApplicationServer.h b/lib/ApplicationFeatures/ApplicationServer.h index c154bc4d11..ea61123b3c 100644 --- a/lib/ApplicationFeatures/ApplicationServer.h +++ b/lib/ApplicationFeatures/ApplicationServer.h @@ -230,6 +230,9 @@ class ApplicationServer { // return VPack options VPackBuilder options(std::unordered_set const& excludes) const; + + // return the program options object + std::shared_ptr options() const { return _options; } // return the server state ServerState state() const { return _state; } diff --git a/lib/ApplicationFeatures/RocksDBOptionFeature.cpp b/lib/ApplicationFeatures/RocksDBOptionFeature.cpp index e9a7a1efb2..b5a69a10fc 100644 --- a/lib/ApplicationFeatures/RocksDBOptionFeature.cpp +++ b/lib/ApplicationFeatures/RocksDBOptionFeature.cpp @@ -153,13 +153,14 @@ void RocksDBOptionFeature::collectOptions(std::shared_ptr option new UInt64Parameter(&_maxTotalWalSize)); options->addOption( - "--rocksdb.delayed_write_rate", + "--rocksdb.delayed-write-rate", "limited write rate to DB (in bytes per second) if we are writing to the " "last mem-table allowed and we allow more than 3 mem-tables, or if we " "have surpassed a certain number of level-0 files and need to slowdown " "writes", new UInt64Parameter(&_delayedWriteRate), arangodb::options::makeFlags(arangodb::options::Flags::Hidden)); + options->addOldOption("rocksdb.delayed_write_rate", "rocksdb.delayed-write-rate"); options->addOption("--rocksdb.min-write-buffer-number-to-merge", "minimum number of write buffers that will be merged "