revision-id: 25507440cec73c987976511047032b3ef38b67a5 (fb-prod201801-220-g25507440cec) parent(s): 60be87fedcce6bfbab7c760b3ca127448b4896eb author: Sergei Petrunia committer: Sergei Petrunia timestamp: 2019-04-01 17:25:02 +0300 message: Range Locking: better initialization a part of the "Unified Lock Mangager Interface" change --- rocksdb | 2 +- storage/rocksdb/ha_rocksdb.cc | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rocksdb b/rocksdb index 190a29d06f4..46d49ea0b7e 160000 --- a/rocksdb +++ b/rocksdb @@ -1 +1 @@ -Subproject commit 190a29d06f4e79d2df4cb513944ac34bd133caa0 +Subproject commit 46d49ea0b7e0267b5c360d45d90a64776477b8ed diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 4071e3ab2a8..6fe877f1f54 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -5060,6 +5060,13 @@ static int rocksdb_init_func(void *const p) { DBUG_RETURN(HA_EXIT_FAILURE); } + tx_db_options.use_range_locking = rocksdb_use_range_locking; + if (rocksdb_use_range_locking) + { + tx_db_options.range_locking_opts.cvt_func= range_endpoint_convert; + tx_db_options.range_locking_opts.cmp_func= range_endpoints_compare; + } + status = rocksdb::TransactionDB::Open( main_opts, tx_db_options, rocksdb_datadir, cf_descr, &cf_handles, &rdb); @@ -5069,17 +5076,10 @@ static int rocksdb_init_func(void *const p) { DBUG_RETURN(HA_EXIT_FAILURE); } - //psergey-todo: this implies that TransactionDB::Open() call above did not - // acquire any locks (if it did, we wont be able switch to another locking - // system): - rdb->use_range_locking= rocksdb_use_range_locking; // psergey - if (rocksdb_use_range_locking) { rocksdb::RangeLockMgrControl *mgr= rdb->get_range_lock_manager(); - mgr->set_endpoint_cmp_functions(range_endpoint_convert, - range_endpoints_compare); mgr->set_max_lock_memory(rocksdb_max_lock_memory); sql_print_information("RocksDB: USING NEW RANGE LOCKING"); sql_print_information("RocksDB: Max lock memory=%lu", rocksdb_max_lock_memory);