rocksdb/utilities
Alex Yang e8180f9901 added public api to schedule flush/compaction, code to prevent race with db::open
Summary:
Fixes T8781168.

Added a new function EnableAutoCompactions in db.h to be publicly
avialable.  This allows compaction to be re-enabled after disabling it via
SetOptions

Refactored code to set the dbptr earlier on in TransactionDB::Open and DB::Open
Temporarily disable auto_compaction in TransactionDB::Open until dbptr is set to
prevent race condition.

Test Plan:
Ran make all check

verified fix on myrocks side:
was able to reproduce the seg fault with
../tools/mysqltest.sh --mem --force rocksdb.drop_table

method was to manually sleep the thread after DB::Open but before TransactionDB ptr was
assigned in transaction_db_impl.cc:
  DB::Open(db_options, dbname, column_families_copy, handles, &db);
  clock_t goal = (60000 * 10) + clock();
  while (goal > clock());
  ...dbptr(aka rdb) gets assigned below

verified my changes fixed the issue.

Also added unit test 'ToggleAutoCompaction' in transaction_test.cc

Reviewers: hermanlee4, anthony

Reviewed By: anthony

Subscribers: alex, dhruba

Differential Revision: https://reviews.facebook.net/D51147
2015-12-03 22:59:44 -08:00
..
backupable Fix ms version Appveyor build error 2015-11-30 11:07:47 -08:00
checkpoint No need to #ifdef test only code on windows 2015-10-22 15:15:37 -07:00
compaction_filters RemoveEmptyValueCompactionFilter - A compaction filter which removes entries which have an empty value 2015-07-16 11:50:10 +01:00
convenience Add function 'GetInfoLogList()' 2015-08-05 16:16:46 -07:00
document Fix build error using Visual Studio 12 2015-10-14 16:05:55 -07:00
flashcache Fix the compilation error in flashcache.cc on Mac 2015-04-07 15:27:23 -07:00
geodb Delete test iterators 2015-11-05 13:30:51 -08:00
leveldb_options Added CompatibleOptions for compatibility with LevelDB Options 2014-11-20 19:24:39 -08:00
memory Fix build broken by previous commit of "option helper refactor" 2015-11-17 16:52:54 -08:00
merge_operators Lint everything 2015-11-16 12:56:21 -08:00
options Add CheckOptionsCompatibility() API to options_util 2015-11-12 16:52:51 -08:00
redis Lint everything 2015-11-16 12:56:21 -08:00
spatialdb Block spatial_db_test in ROCKSDB_LITE 2015-07-13 18:35:03 -07:00
table_properties_collectors Pass column family ID to table property collector 2015-10-09 14:36:51 -07:00
transactions added public api to schedule flush/compaction, code to prevent race with db::open 2015-12-03 22:59:44 -08:00
ttl Skip unsupported tests in ROCKSDB_LITE 2015-07-20 11:24:54 -07:00
write_batch_with_index Return MergeInProgress when fetching from transactions or WBWI with overwrite_key 2015-09-30 11:14:42 -07:00
merge_operators.h Add appropriate LICENSE and Copyright message. 2013-10-16 17:48:41 -07:00