1
0
Fork 0
This commit is contained in:
Jan 2019-08-19 22:18:57 +02:00 committed by KVS85
parent e737795f7b
commit eb5f4241a5
5 changed files with 27 additions and 6 deletions

View File

@ -1,6 +1,13 @@
v3.4.8 (XXXX-XX-XX)
-------------------
* Fixed issue #9654: honor value of `--rocksdb.max-write-buffer-number` if it
is set to at least 9 (which is the recommended value). Ignore it if it is
set to a lower value than 9, and warn the end user about it.
Previous versions of ArangoDB always silently ignored the value of this setting
and effectively hard-coded the value to 9.
* Fixed cut'n'pasting code from the documentation into arangosh.
* Refactor maintenance to use a TakeoverShardLeadership job. This fixes a bug

View File

@ -557,9 +557,18 @@ void RocksDBEngine::start() {
_options.db_write_buffer_size = opts->_totalWriteBufferSize;
}
// this is cfFamilies.size() + 2 ... but _option needs to be set before
// building cfFamilies
_options.max_write_buffer_number = 7 + 2;
if (!application_features::ApplicationServer::server->options()->processingResult().touched("rocksdb.max-write-buffer-number")) {
// user hasn't explicitly set the number of write buffers, so we use a default value based
// on the number of column families
// this is cfFamilies.size() + 2 ... but _option needs to be set before
// building cfFamilies
// Update max_write_buffer_number above if you change number of families used
_options.max_write_buffer_number = 7 + 2;
} else if (_options.max_write_buffer_number < 7 + 2) {
// user set the value explicitly, and it is lower than recommended
LOG_TOPIC(WARN, Logger::ENGINES) << "ignoring value for option `--rocksdb.max-write-buffer-number` because it is lower than recommended";
_options.max_write_buffer_number = 7 + 2;
}
// cf options for definitons (dbs, collections, views, ...)
rocksdb::ColumnFamilyOptions definitionsCF(_options);
@ -597,8 +606,9 @@ void RocksDBEngine::start() {
cfFamilies.emplace_back("VPackIndex", vpackFixedPrefCF); // 4
cfFamilies.emplace_back("GeoIndex", fixedPrefCF); // 5
cfFamilies.emplace_back("FulltextIndex", fixedPrefCF); // 6
// DO NOT FORGET TO DESTROY THE CFs ON CLOSE
// Update max_write_buffer_number above if you change number of families used
TRI_ASSERT(static_cast<int>(_options.max_write_buffer_number) >= static_cast<int>(cfFamilies.size()));
// Update max_write_buffer_number above if you change number of families used
// validate sizes of existing RocksDB journal files
// RocksDB may just crash when opening a logfile with an unexpected size

View File

@ -229,6 +229,9 @@ class ApplicationServer {
// return VPack options
VPackBuilder options(std::unordered_set<std::string> const& excludes) const;
// return the program options object
std::shared_ptr<options::ProgramOptions> options() const { return _options; }
// return the server state
ServerState state() const { return _state; }

View File

@ -46,7 +46,7 @@ RocksDBOptionFeature::RocksDBOptionFeature(application_features::ApplicationServ
_transactionLockTimeout(rocksDBTrxDefaults.transaction_lock_timeout),
_totalWriteBufferSize(rocksDBDefaults.db_write_buffer_size),
_writeBufferSize(rocksDBDefaults.write_buffer_size),
_maxWriteBufferNumber(rocksDBDefaults.max_write_buffer_number),
_maxWriteBufferNumber(7 + 2), // number of column families plus 2
_maxTotalWalSize(80 << 20),
_delayedWriteRate(rocksDBDefaults.delayed_write_rate),
_minWriteBufferNumberToMerge(rocksDBDefaults.min_write_buffer_number_to_merge),

View File

@ -49,6 +49,7 @@ class RocksDBOptionFeature final : public application_features::ApplicationFeatu
std::string _walDirectory;
uint64_t _totalWriteBufferSize;
uint64_t _writeBufferSize;
// Update max_write_buffer_number above if you change number of families used
uint64_t _maxWriteBufferNumber;
uint64_t _maxTotalWalSize;
uint64_t _delayedWriteRate;