Skip to content

Commit

Permalink
libroach: use FlushWAL instead of SyncWAL
Browse files Browse the repository at this point in the history
Tell RocksDB that we will manually flush the wal via the
`manual_wal_flush` option. Replace `SyncWAL()` with `FlushWAL(true)`. We
"sync" approximately half of writes. The effect of this change is to
avoid calling `write(2)` on the writes which we are not syncing.

Fixes cockroachdb#22443

Release note: None
  • Loading branch information
petermattis committed Jun 26, 2018
1 parent 5914b07 commit a321424
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion c-deps/libroach/db.cc
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ DBStatus DBSyncWAL(DBEngine* db) {
options.sync = true;
return ToDBStatus(db->rep->Write(options, &batch));
#else
return ToDBStatus(db->rep->SyncWAL());
return ToDBStatus(db->rep->FlushWAL(true /* sync */));
#endif
}

Expand Down
1 change: 1 addition & 0 deletions c-deps/libroach/options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ rocksdb::Options DBMakeOptions(DBOptions db_opts) {
// of sstables.
options.target_file_size_base = 4 << 20; // 4 MB
options.target_file_size_multiplier = 2;
options.manual_wal_flush = true;

// Because we open a long running rocksdb instance, we do not want the
// manifest file to grow unbounded. Assuming each manifest entry is about 1
Expand Down

0 comments on commit a321424

Please sign in to comment.