diff --git a/CHANGELOG b/CHANGELOG index e75e60d126db..897a2c11f948 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,11 @@ devel ----- +* Honor the value of startup option `--rocksdb.sync-interval` on Windows, too. + Previously, the value was ignored and WAL syncing on Windows was using a + different code paths than on the other supported platforms. Now syncing is + unified across all platforms, and they all call RocksDB's `SyncWAL()`. + * Updated ArangoDB Starter to 0.15.1-preview-4. * APM-132: Clean up collection statuses diff --git a/arangod/RocksDBEngine/Methods/RocksDBTrxBaseMethods.cpp b/arangod/RocksDBEngine/Methods/RocksDBTrxBaseMethods.cpp index 3b967e203322..369ae1365d96 100644 --- a/arangod/RocksDBEngine/Methods/RocksDBTrxBaseMethods.cpp +++ b/arangod/RocksDBEngine/Methods/RocksDBTrxBaseMethods.cpp @@ -348,17 +348,6 @@ arangodb::Result RocksDBTrxBaseMethods::doCommit() { // if we fail during commit, make sure we remove blockers, etc. auto cleanupCollTrx = scopeGuard([this]() { _state->cleanupCollections(); }); -#ifdef _WIN32 - // set wait for sync flag if required - // we do this only for Windows here, because all other platforms use the - // RocksDB SyncThread to do the syncing - if (_state->waitForSync()) { - rocksdb::WriteOptions wo; - wo.sync = true; - _rocksTransaction->SetWriteOptions(wo); - } -#endif - // total number of sequence ID consuming records uint64_t numOps = _rocksTransaction->GetNumPuts() + _rocksTransaction->GetNumDeletes() + @@ -387,8 +376,7 @@ arangodb::Result RocksDBTrxBaseMethods::doCommit() { _state->commitCollections(_lastWrittenOperationTick); cleanupCollTrx.cancel(); -#ifndef _WIN32 - // wait for sync if required, for all other platforms but Windows + // wait for sync if required if (_state->waitForSync()) { auto& selector = _state->vocbase().server().getFeature(); auto& engine = selector.engine(); @@ -402,7 +390,6 @@ arangodb::Result RocksDBTrxBaseMethods::doCommit() { return RocksDBSyncThread::sync(engine.db()->GetBaseDB()); } } -#endif return Result(); } diff --git a/arangod/RocksDBEngine/RocksDBEngine.cpp b/arangod/RocksDBEngine/RocksDBEngine.cpp index acea6a6dd34b..0b9bdf0e3796 100644 --- a/arangod/RocksDBEngine/RocksDBEngine.cpp +++ b/arangod/RocksDBEngine/RocksDBEngine.cpp @@ -184,12 +184,7 @@ RocksDBEngine::RocksDBEngine(application_features::ApplicationServer& server) _pruneWaitTimeInitial(180.0), _maxWalArchiveSizeLimit(0), _releasedTick(0), -#ifdef _WIN32 - // background syncing is not supported on Windows - _syncInterval(0), -#else _syncInterval(100), -#endif _syncDelayThreshold(5000), _requiredDiskFreePercentage(0.01), _requiredDiskFreeBytes(16 * 1024 * 1024), @@ -410,14 +405,6 @@ void RocksDBEngine::validateOptions(std::shared_ptr opt } } -#ifdef _WIN32 - if (_syncInterval > 0) { - LOG_TOPIC("68301", WARN, arangodb::Logger::CONFIG) - << "automatic syncing of RocksDB WAL via background thread is not " - << " supported on this platform"; - } -#endif - if (_pruneWaitTimeInitial < 10) { LOG_TOPIC("a9667", WARN, arangodb::Logger::ENGINES) << "consider increasing the value for " diff --git a/arangod/RocksDBEngine/RocksDBSyncThread.cpp b/arangod/RocksDBEngine/RocksDBSyncThread.cpp index dd3e80bf4622..7aa85b6c9e23 100644 --- a/arangod/RocksDBEngine/RocksDBSyncThread.cpp +++ b/arangod/RocksDBEngine/RocksDBSyncThread.cpp @@ -75,17 +75,12 @@ Result RocksDBSyncThread::syncWal() { } Result RocksDBSyncThread::sync(rocksdb::DB* db) { -#ifndef _WIN32 - // if called on Windows, we would get the following error from RocksDB: - // > Not implemented: SyncWAL() is not supported for this implementation of - // WAL file LOG_TOPIC("a3978", TRACE, Logger::ENGINES) << "syncing RocksDB WAL"; rocksdb::Status status = db->SyncWAL(); if (!status.ok()) { return rocksutils::convertStatus(status); } -#endif return Result(); }