8000 experiment to check if SyncWAL works on Windows (#14551) · arangodb/arangodb@d491680 · GitHub
[go: up one dir, main page]

Skip to content

Commit d491680

Browse files
authored
experiment to check if SyncWAL works on Windows (#14551)
1 parent aad0dd2 commit d491680

File tree

4 files changed

+6
-32
lines changed

4 files changed

+6
-32
lines changed

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
devel
22
-----
33

4+
* Honor the value of startup option `--rocksdb.sync-interval` on Windows, too.
5+
Previously, the value was ignored and WAL syncing on Windows was using a
6+
different code paths than on the other supported platforms. Now syncing is
7+
unified across all platforms, and they all call RocksDB's `SyncWAL()`.
8+
49
* Updated ArangoDB Starter to 0.15.1-preview-4.
510

611
* APM-132: Clean up collection statuses

arangod/RocksDBEngine/Methods/RocksDBTrxBaseMethods.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -348,17 +348,6 @@ arangodb::Result RocksDBTrxBaseMethods::doCommit() {
348348
// if we fail during commit, make sure we remove blockers, etc.
349349
auto cleanupCollTrx = scopeGuard([this]() { _state->cleanupCollections(); });
350350

351-
#ifdef _WIN32
352-
// set wait for sync flag if required
353-
// we do this only for Windows here, because all other platforms use the
354-
// RocksDB SyncThread to do the syncing
355-
if (_state->waitForSync()) {
356-
rocksdb::WriteOptions wo;
357-
wo.sync = true;
358-
_rocksTransaction->SetWriteOptions(wo);
359-
}
360-
#endif
361-
362351
// total number of sequence ID consuming records
363352
uint64_t numOps = _rocksTransaction->GetNumPuts() +
364353
_rocksTransaction->GetNumDeletes() +
@@ -387,8 +376,7 @@ arangodb::Result RocksDBTrxBaseMethods::doCommit() {
387376
_state->commitCollections(_lastWrittenOperationTick);
388377
cleanupCollTrx.cancel();
389378

390-
#ifndef _WIN32
391-
// wait for sync if required, for all other platforms but Windows
379+
// wait for sync if required
392380
if (_state->waitForSync()) {
393381
auto& selector = _state->vocbase().server().getFeature<EngineSelectorFeature>();
394382
auto& engine = selector.engine<RocksDBEngine>();
@@ -402,7 +390,6 @@ arangodb::Result RocksDBTrxBaseMethods::doCommit() {
402390
return RocksDBSyncThread::sync(engine.db()->GetBaseDB());
403391
}
404392
}
405-
#endif
406393

407394
return Result();
408395
}

arangod/RocksDBEngine/RocksDBEngine.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,7 @@ RocksDBEngine::RocksDBEngine(application_features::ApplicationServer& server)
184184
_pruneWaitTimeInitial(180.0),
185185
_maxWalArchiveSizeLimit(0),
186186
_releasedTick(0),
187-
#ifdef _WIN32
188-
// background syncing is not supported on Windows
189-
_syncInterval(0),
190-
#else
191187
_syncInterval(100),
192-
#endif
193188
_syncDelayThreshold(5000),
194189
_requiredDiskFreePercentage(0.01),
195190
_requiredDiskFreeBytes(16 * 1024 * 1024),
@@ -410,14 +405,6 @@ void RocksDBEngine::validateOptions(std::shared_ptr<options::ProgramOptions> opt
410405
}
411406
}
412407

413-
#ifdef _WIN32
414-
if (_syncInterval > 0) {
415-
LOG_TOPIC("68301", WARN, arangodb::Logger::CONFIG)
416-
<< "automatic syncing of RocksDB WAL via background thread is not "
417-
<< " supported on this platform";
418-
}
419-
#endif
420-
421408
if (_pruneWaitTimeInitial < 10) {
422409
LOG_TOPIC("a9667", WARN, arangodb::Logger::ENGINES)
423410
<< "consider increasing the value for "

arangod/RocksDBEngine/RocksDBSyncThread.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,12 @@ Result RocksDBSyncThread::syncWal() {
7575
}
7676

7777
Result RocksDBSyncThread::sync(rocksdb::DB* db) {
78-
#ifndef _WIN32
79-
// if called on Windows, we would get the following error from RocksDB:
80-
// > Not implemented: SyncWAL() is not supported for this implementation of
81-
// WAL file
8278
LOG_TOPIC("a3978", TRACE, Logger::ENGINES) << "syncing RocksDB WAL";
8379

8480
rocksdb::Status status = db->SyncWAL();
8581
if (!status.ok()) {
8682
return rocksutils::convertStatus(status);
8783
}
88-
#endif
8984
return Result();
9085
}
9186

0 commit comments

Comments
 (0)
0