[Commits] 3abdc95f0: Range Locking: fix Makefile-based debug build
revision-id: 3abdc95f082d80a3ce76bad7d6d319f8706429b2 (v5.8-1027-g3abdc95f0) parent(s): d4bf4b4197d8887c119bcb5d87db6ba5feb9aabc author: Sergei Petrunia committer: Sergei Petrunia timestamp: 2019-04-05 20:21:19 +0300 message: Range Locking: fix Makefile-based debug build - List correct files in the Makefile - Lots of -Werror=unused-parameter errors --- Makefile | 3 +++ include/rocksdb/utilities/transaction.h | 5 ++--- src.mk | 8 -------- .../transactions/range_locking/standalone_port.cc | 2 +- utilities/transactions/transaction_lock_mgr.cc | 21 +++++++++++---------- utilities/transactions/transaction_lock_mgr.h | 8 ++++---- 6 files changed, 21 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index 9ece4310c..3b9b5453b 100644 --- a/Makefile +++ b/Makefile @@ -1564,6 +1564,9 @@ blob_db_test: utilities/blob_db/blob_db_test.o $(LIBOBJECTS) $(TESTHARNESS) repeatable_thread_test: util/repeatable_thread_test.o $(LIBOBJECTS) $(TESTHARNESS) $(AM_LINK) +range_locking_test: utilities/transactions/range_locking_test.o $(LIBOBJECTS) $(TESTHARNESS) + $(AM_LINK) + #------------------------------------------------- # make install related stuff INSTALL_PATH ?= /usr/local diff --git a/include/rocksdb/utilities/transaction.h b/include/rocksdb/utilities/transaction.h index 5a2932363..8a15a3bbd 100644 --- a/include/rocksdb/utilities/transaction.h +++ b/include/rocksdb/utilities/transaction.h @@ -255,9 +255,8 @@ class Transaction { // Get a range lock on [start_endpoint; end_endpoint]. // Note: range endpoints generally a use a different data format than // ranges. - virtual Status GetRangeLock(ColumnFamilyHandle* column_family, - const Slice& start_endp, - const Slice& end_endp) { + virtual Status GetRangeLock(ColumnFamilyHandle*, + const Slice&, const Slice&) { return Status::NotSupported(); } diff --git a/src.mk b/src.mk index de0644cac..2a19287e0 100644 --- a/src.mk +++ b/src.mk @@ -218,20 +218,12 @@ LIB_SOURCES = \ utilities/write_batch_with_index/write_batch_with_index.cc \ utilities/write_batch_with_index/write_batch_with_index_internal.cc \ utilities/transactions/range_locking/locktree/keyrange.cc \ - utilities/transactions/range_locking/locktree/keyrange.h \ - utilities/transactions/range_locking/locktree/txnid_set.h \ utilities/transactions/range_locking/locktree/range_buffer.cc \ - utilities/transactions/range_locking/locktree/locktree.h \ - utilities/transactions/range_locking/locktree/treenode.h \ utilities/transactions/range_locking/locktree/wfg.cc \ utilities/transactions/range_locking/locktree/lock_request.cc \ utilities/transactions/range_locking/locktree/locktree.cc \ - utilities/transactions/range_locking/locktree/range_buffer.h \ utilities/transactions/range_locking/locktree/manager.cc \ - utilities/transactions/range_locking/locktree/wfg.h \ utilities/transactions/range_locking/locktree/txnid_set.cc \ - utilities/transactions/range_locking/locktree/lock_request.h \ - utilities/transactions/range_locking/locktree/concurrent_tree.h \ utilities/transactions/range_locking/util/dbt.cc \ utilities/transactions/range_locking/util/memarena.cc \ utilities/transactions/range_locking/standalone_port.cc \ diff --git a/utilities/transactions/range_locking/standalone_port.cc b/utilities/transactions/range_locking/standalone_port.cc index f87105e5b..dbdeb0b97 100644 --- a/utilities/transactions/range_locking/standalone_port.cc +++ b/utilities/transactions/range_locking/standalone_port.cc @@ -60,7 +60,7 @@ toku_instr_key *manager_escalator_mutex_key; // portability/memory.cc size_t -toku_memory_footprint(void * p, size_t touched) +toku_memory_footprint(void* , size_t touched) { return touched; } diff --git a/utilities/transactions/transaction_lock_mgr.cc b/utilities/transactions/transaction_lock_mgr.cc index f15d9df21..e0802fb25 100644 --- a/utilities/transactions/transaction_lock_mgr.cc +++ b/utilities/transactions/transaction_lock_mgr.cc @@ -795,7 +795,7 @@ Status RangeLockMgr::TryRangeLock(PessimisticTransaction* txn, uint32_t column_family_id, const rocksdb::Slice &start_key, const rocksdb::Slice &end_key, - bool exclusive) { + bool /*exclusive*/) { toku::lock_request request; request.create(mutex_factory_); DBT start_key_dbt, end_key_dbt; @@ -836,8 +836,9 @@ Status RangeLockMgr::TryRangeLock(PessimisticTransaction* txn, autovector<TransactionID> wait_ids; bool done= false; - static void lock_wait_callback(void *cdata, TXNID waiter, TXNID waitee) { + static void lock_wait_callback(void *cdata, TXNID /*waiter*/, TXNID waitee) { auto self= (struct st_wait_info*)cdata; + // we know that the waiter is self->txn->GetID() (TODO: assert?) if (!self->done) { self->wait_ids.push_back(waitee); @@ -893,7 +894,7 @@ Status RangeLockMgr::TryRangeLock(PessimisticTransaction* txn, // (currently it is the same as getting a range lock) Status RangeLockMgr::TryLock(PessimisticTransaction* txn, uint32_t column_family_id, - const std::string& key, Env* env, + const std::string& key, Env*, bool exclusive) { std::string endpoint; convert_key_to_endpoint(rocksdb::Slice(key.data(), key.size()), &endpoint); @@ -904,7 +905,7 @@ Status RangeLockMgr::TryLock(PessimisticTransaction* txn, static void range_lock_mgr_release_lock_int(toku::locktree *lt, const PessimisticTransaction* txn, - uint32_t column_family_id, + uint32_t /*column_family_id*/, const std::string& key) { DBT key_dbt; toku_fill_dbt(&key_dbt, key.data(), key.size()); @@ -917,13 +918,13 @@ range_lock_mgr_release_lock_int(toku::locktree *lt, void RangeLockMgr::UnLock(PessimisticTransaction* txn, uint32_t column_family_id, - const std::string& key, Env* env) { + const std::string& key, Env*) { range_lock_mgr_release_lock_int(lt, txn, column_family_id, key); toku::lock_request::retry_all_lock_requests(lt, nullptr /* lock_wait_needed_callback */); } void RangeLockMgr::UnLock(const PessimisticTransaction* txn, - const TransactionKeyMap* key_map, Env* env) { + const TransactionKeyMap* key_map, Env*) { //TODO: if we collect all locks in a range buffer and then // make one call to lock_tree::release_locks(), will that be faster? for (auto& key_map_iter : *key_map) { @@ -939,7 +940,7 @@ void RangeLockMgr::UnLock(const PessimisticTransaction* txn, toku::lock_request::retry_all_lock_requests(lt, nullptr /* lock_wait_needed_callback */); } -void RangeLockMgr::UnLockAll(const PessimisticTransaction* txn, Env* env) { +void RangeLockMgr::UnLockAll(const PessimisticTransaction* txn, Env*) { // owned_locks may hold nullptr if the transaction has never acquired any // locks. @@ -1023,11 +1024,11 @@ RangeLockMgr::RangeLockMgr(TransactionDB* txn_db, @param lt Lock Tree where escalation is happening (currently there is only one) @param buffer Escalation result: list of locks that this transaction now owns in this lock tree. - @param extra Callback context + @param void* Callback context */ -void RangeLockMgr::on_escalate(TXNID txnid, const locktree *lt, - const range_buffer &buffer, void *extra) { +void RangeLockMgr::on_escalate(TXNID txnid, const locktree*, + const range_buffer &buffer, void *) { auto txn= (PessimisticTransaction*)txnid; RangeLockList* trx_locks= (RangeLockList*)txn->owned_locks.get(); diff --git a/utilities/transactions/transaction_lock_mgr.h b/utilities/transactions/transaction_lock_mgr.h index e3de698f2..d6c5479f2 100644 --- a/utilities/transactions/transaction_lock_mgr.h +++ b/utilities/transactions/transaction_lock_mgr.h @@ -195,8 +195,8 @@ class RangeLockMgr : public BaseLockMgr, public RangeLockMgrControl { public: - void AddColumnFamily(uint32_t column_family_id) override { /* do nothing */ } - void RemoveColumnFamily(uint32_t column_family_id) override { /* do nothing */ } + void AddColumnFamily(uint32_t) override { /* do nothing */ } + void RemoveColumnFamily(uint32_t) override { /* do nothing */ } Status TryLock(PessimisticTransaction* txn, uint32_t column_family_id, const std::string& key, Env* env, bool exclusive) override ; @@ -263,8 +263,8 @@ class RangeLockMgr : static int compare_dbt_endpoints(__toku_db*, void *arg, const DBT *a_key, const DBT *b_key); // Callbacks - static int on_create(locktree *lt, void *extra) { return 0; /* no error */ } - static void on_destroy(locktree *lt) {} + static int on_create(locktree*, void*) { return 0; /* no error */ } + static void on_destroy(locktree*) {} static void on_escalate(TXNID txnid, const locktree *lt, const range_buffer &buffer, void *extra);
participants (1)
-
Sergei Petrunia