]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
Make a copy of MutableCFOptions to avoid race condition (#4876)
authorYanqin Jin <yanqin@fb.com>
Sat, 12 Jan 2019 01:40:44 +0000 (17:40 -0800)
committerYanqin Jin <yanqin@fb.com>
Thu, 31 Jan 2019 23:06:08 +0000 (15:06 -0800)
commitacba14b3d903bed94a3345c471bd62b282c84f33
tree0da2633ba1bf845801bb0b12ab7a7e2cd8b43643
parent53f760b8a85ca23eedde96d98e8114e0562b6544
Make a copy of MutableCFOptions to avoid race condition (#4876)

Summary:
If we do not do this, then reading MutableCFOptions may have a race condition
with SetOptions which modifies MutableCFOptions.

Also reserve space in advance for vectors to avoid reallocation changing the
address of its elements.

Test plan
```
$make clean && make -j32 all check
$make clean && COMPILE_WITH_TSAN=1 make -j32 all check
$make clean && COMPILE_WITH_ASAN=1 make -j32 all check
```
Pull Request resolved: https://github.com/facebook/rocksdb/pull/4876

Differential Revision: D13644500

Pulled By: riversand963

fbshipit-source-id: 4b8112c5c819d5a2922bb61ad1521b3d2fb2fd47
db/db_impl_compaction_flush.cc