rocksdb/port/win
Peter Dillinger d010b02e86 Fix race in options taking effect (#11929)
Summary:
In follow-up to https://github.com/facebook/rocksdb/issues/11922, fix a race in functions like CreateColumnFamily and SetDBOptions where the DB reports one option setting but a different one is left in effect.

To fix, we can add an extra mutex around these rare operations. We don't want to hold the DB mutex during I/O or other slow things because of the many purposes it serves, but a mutex more limited to these cases should be fine.

I believe this would fix a write-write race in https://github.com/facebook/rocksdb/issues/10079 but not the read-write race.

Intended follow-up to this:
* Should be able to remove write thread synchronization from DBImpl::WriteOptionsFile

Pull Request resolved: https://github.com/facebook/rocksdb/pull/11929

Test Plan:
Added two mini-stress style regression tests that fail with >1% probability before this change:
DBOptionsTest::SetStatsDumpPeriodSecRace
ColumnFamilyTest::CreateAndDropPeriodicRace

I haven't reproduced such an inconsistency between in-memory options and on disk latest options, but this change at least improves safety and adds a test anyway:
DBOptionsTest::SetStatsDumpPeriodSecRace

Reviewed By: ajkr

Differential Revision: D50024506

Pulled By: pdillinger

fbshipit-source-id: 1e99a9ed4d96fdcf3ac5061ec6b3cee78aecdda4
2023-10-12 10:05:23 -07:00
..
env_default.cc Remove using namespace (#9369) 2022-01-12 09:31:12 -08:00
env_win.cc Support reservation in thread pool (#10278) 2022-07-08 19:48:09 -07:00
env_win.h Add an interface to provide support for underlying FS to pass their own buffer during reads (#11324) 2023-06-23 11:48:49 -07:00
io_win.cc Fix GetWindowsErrSz nullptr bug (#10282) 2022-06-29 20:41:54 -07:00
io_win.h clang format files under port/ (#10849) 2022-10-24 16:56:01 -07:00
port_win.cc Fix potential ambiguities in/around port/sys_time.h (#10045) 2022-05-24 18:20:17 -07:00
port_win.h Fix race in options taking effect (#11929) 2023-10-12 10:05:23 -07:00
win_jemalloc.cc clang format files under port/ (#10849) 2022-10-24 16:56:01 -07:00
win_logger.cc clang format files under port/ (#10849) 2022-10-24 16:56:01 -07:00
win_logger.h clang format files under port/ (#10849) 2022-10-24 16:56:01 -07:00
win_thread.cc clang format files under port/ (#10849) 2022-10-24 16:56:01 -07:00
win_thread.h clang format files under port/ (#10849) 2022-10-24 16:56:01 -07:00
xpress_win.cc clang format files under port/ (#10849) 2022-10-24 16:56:01 -07:00
xpress_win.h clang format files under port/ (#10849) 2022-10-24 16:56:01 -07:00