mirror of https://gitee.com/bigwinds/arangodb
added option `--rocksdb.use-file-logging` (#6308)
This commit is contained in:
parent
191ae2dc43
commit
840ad8c20d
|
@ -9,6 +9,12 @@ devel
|
|||
on path (vertices and edges) have not been applied. In SmartGraphs the checks
|
||||
have been executed properly.
|
||||
|
||||
* added option `--rocksdb.use-file-logging` to enable writing of RocksDB's own
|
||||
informational LOG files into RocksDB's database directory.
|
||||
|
||||
This option is turned off by default, but can be enabled for debugging RocksDB
|
||||
internals and performance.
|
||||
|
||||
* improved error messages when managing Foxx services
|
||||
|
||||
Install/replace/upgrade will now provide additional information when an error
|
||||
|
|
|
@ -240,3 +240,20 @@ have been executed without the *waitForSync* attribute.
|
|||
|
||||
Note: this option is not supported on Windows platforms. Setting the option to
|
||||
a value greater 0 will produce a startup warning.
|
||||
|
||||
`--rocksdb.use-file-logging`
|
||||
|
||||
When set to *true*, enables writing of RocksDB's own informational LOG files into
|
||||
RocksDB's database directory.
|
||||
|
||||
This option is turned off by default, but can be enabled for debugging RocksDB
|
||||
internals and performance.
|
||||
|
||||
`--rocksdb.debug-logging`
|
||||
|
||||
When set to *true*, enables verbose logging of RocksDB's actions into the logfile
|
||||
written by ArangoDB (if option `--rocksdb.use-file-logging` is off) or RocksDB's
|
||||
own log (if option `--rocksdb.use-file-logging` is on).
|
||||
|
||||
This option is turned off by default, but can be enabled for debugging RocksDB
|
||||
internals and performance.
|
||||
|
|
|
@ -420,18 +420,28 @@ void RocksDBEngine::start() {
|
|||
|
||||
// intentionally set the RocksDB logger to warning because it will
|
||||
// log lots of things otherwise
|
||||
if (!_debugLogging) {
|
||||
_options.info_log_level = rocksdb::InfoLogLevel::ERROR_LEVEL;
|
||||
} else {
|
||||
if (_debugLogging) {
|
||||
_options.info_log_level = rocksdb::InfoLogLevel::DEBUG_LEVEL;
|
||||
} // else
|
||||
} else {
|
||||
if (!opts->_useFileLogging) {
|
||||
// if we don't use file logging but log into ArangoDB's logfile,
|
||||
// we only want real errors
|
||||
_options.info_log_level = rocksdb::InfoLogLevel::ERROR_LEVEL;
|
||||
}
|
||||
}
|
||||
|
||||
auto logger = std::make_shared<RocksDBLogger>(_options.info_log_level);
|
||||
_options.info_log = logger;
|
||||
std::shared_ptr<RocksDBLogger> logger;
|
||||
|
||||
if (!opts->_useFileLogging) {
|
||||
// if option "--rocksdb.use-file-logging" is set to false, we will use
|
||||
// our own logger that logs to ArangoDB's logfile
|
||||
logger = std::make_shared<RocksDBLogger>(_options.info_log_level);
|
||||
_options.info_log = logger;
|
||||
|
||||
if (!_debugLogging) {
|
||||
logger->disable();
|
||||
} // if
|
||||
if (!_debugLogging) {
|
||||
logger->disable();
|
||||
} // if
|
||||
}
|
||||
|
||||
if (opts->_enableStatistics) {
|
||||
_options.statistics = rocksdb::CreateDBStatistics();
|
||||
|
@ -629,7 +639,9 @@ void RocksDBEngine::start() {
|
|||
arangodb::rocksdbStartupVersionCheck(_db, dbExisted);
|
||||
|
||||
// only enable logger after RocksDB start
|
||||
logger->enable();
|
||||
if (logger != nullptr) {
|
||||
logger->enable();
|
||||
}
|
||||
|
||||
if (_syncInterval > 0) {
|
||||
_syncThread.reset(
|
||||
|
|
|
@ -79,7 +79,8 @@ RocksDBOptionFeature::RocksDBOptionFeature(
|
|||
_useFSync(rocksDBDefaults.use_fsync),
|
||||
_skipCorrupted(false),
|
||||
_dynamicLevelBytes(true),
|
||||
_enableStatistics(false) {
|
||||
_enableStatistics(false),
|
||||
_useFileLogging(false) {
|
||||
// setting the number of background jobs to
|
||||
_maxBackgroundJobs = static_cast<int32_t>(std::max((size_t)2,
|
||||
std::min(TRI_numberProcessors(), (size_t)8)));
|
||||
|
@ -261,6 +262,10 @@ void RocksDBOptionFeature::collectOptions(
|
|||
"that way RocksDB's compaction is doing sequential instead of random "
|
||||
"reads.",
|
||||
new UInt64Parameter(&_compactionReadaheadSize));
|
||||
|
||||
options->addHiddenOption("--rocksdb.use-file-logging",
|
||||
"use a file-base logger for RocksDB's own logs",
|
||||
new BooleanParameter(&_useFileLogging));
|
||||
|
||||
options->addHiddenOption("--rocksdb.wal-recovery-skip-corrupted",
|
||||
"skip corrupted records in WAL recovery",
|
||||
|
|
|
@ -80,6 +80,7 @@ class RocksDBOptionFeature final
|
|||
bool _skipCorrupted;
|
||||
bool _dynamicLevelBytes;
|
||||
bool _enableStatistics;
|
||||
bool _useFileLogging;
|
||||
};
|
||||
|
||||
} // namespace arangodb
|
||||
|
|
Loading…
Reference in New Issue