[Commits] 0ba14a1ef: Range Locking: return proper error code from RangeLockMgr::TryRangeLock
revision-id: 0ba14a1efa8f4cfccedc85c7efa317be35c60333 (v5.8-1018-g0ba14a1ef) parent(s): 0320154e8fa4a3a24f1a65fec2487e490dfb8507 author: Sergei Petrunia committer: Sergei Petrunia timestamp: 2018-11-29 22:48:52 +0300 message: Range Locking: return proper error code from RangeLockMgr::TryRangeLock --- utilities/transactions/transaction_lock_mgr.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/utilities/transactions/transaction_lock_mgr.cc b/utilities/transactions/transaction_lock_mgr.cc index ae317742e..db856f725 100644 --- a/utilities/transactions/transaction_lock_mgr.cc +++ b/utilities/transactions/transaction_lock_mgr.cc @@ -350,10 +350,18 @@ Status RangeLockMgr::TryRangeLock(PessimisticTransaction* txn, nullptr, /* killed_callback */ nullptr /* lock_wait_needed_callback*/ ); request.destroy(); - if (r != 0) - return Status::TimedOut(Status::SubCode::kLockTimeout); - - return Status::OK(); + switch (r) { + case 0: + return Status::OK(); + case DB_LOCK_NOTGRANTED: + return Status::TimedOut(Status::SubCode::kLockTimeout); + case TOKUDB_OUT_OF_LOCKS: + debug_dump_locks(this); + return Status::Busy(Status::SubCode::kLockLimit); + default: + assert(0); + return Status::Busy(Status::SubCode::kLockLimit); + } }
participants (1)
-
Sergei Petrunia