rocksdb/utilities/transactions
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
..
optimistic_transaction_db_impl.cc Pessimistic Transactions 2015-08-11 17:52:23 -07:00
optimistic_transaction_db_impl.h Pessimistic Transactions 2015-08-11 17:52:23 -07:00
optimistic_transaction_impl.cc Deferred snapshot creation in transactions 2015-10-09 15:46:16 -07:00
optimistic_transaction_impl.h Transactions: Release Locks when rolling back to a savepoint 2015-09-11 18:10:50 -07:00
optimistic_transaction_test.cc Transaction stats 2015-09-09 13:35:53 -07:00
transaction_base.cc Deferred snapshot creation in transactions 2015-10-09 15:46:16 -07:00
transaction_base.h Add ClearSnapshot() 2015-10-16 11:53:30 -07:00
transaction_db_impl.cc added public api to schedule flush/compaction, code to prevent race with db::open 2015-12-03 22:59:44 -08:00
transaction_db_impl.h Transactions: Release Locks when rolling back to a savepoint 2015-09-11 18:10:50 -07:00
transaction_db_mutex_impl.cc TransactionDB Custom Locking API 2015-09-08 17:03:57 -07:00
transaction_db_mutex_impl.h TransactionDB Custom Locking API 2015-09-08 17:03:57 -07:00
transaction_impl.cc Deferred snapshot creation in transactions 2015-10-09 15:46:16 -07:00
transaction_impl.h Deferred snapshot creation in transactions 2015-10-09 15:46:16 -07:00
transaction_lock_mgr.cc TransactionDB Custom Locking API 2015-09-08 17:03:57 -07:00
transaction_lock_mgr.h TransactionDB Custom Locking API 2015-09-08 17:03:57 -07:00
transaction_test.cc added public api to schedule flush/compaction, code to prevent race with db::open 2015-12-03 22:59:44 -08:00
transaction_util.cc Transactions: Release Locks when rolling back to a savepoint 2015-09-11 18:10:50 -07:00
transaction_util.h Transactions: Release Locks when rolling back to a savepoint 2015-09-11 18:10:50 -07:00