You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@quickstep.apache.org by ji...@apache.org on 2017/10/05 22:17:07 UTC
[02/40] incubator-quickstep git commit: Bug fix in LockManager loop
Bug fix in LockManager loop
- Added a false condition for acquire lock
- Added clarifying comment.
Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/9cbb930b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/9cbb930b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/9cbb930b
Branch: refs/heads/new-op
Commit: 9cbb930b5adb589f7a2ba8140d8d59227c9a570e
Parents: bf455e2
Author: Harshad Deshmukh <hb...@apache.org>
Authored: Wed Sep 27 10:02:10 2017 -0500
Committer: Harshad Deshmukh <hb...@apache.org>
Committed: Fri Sep 29 10:42:41 2017 -0500
----------------------------------------------------------------------
transaction/LockManager.cpp | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/9cbb930b/transaction/LockManager.cpp
----------------------------------------------------------------------
diff --git a/transaction/LockManager.cpp b/transaction/LockManager.cpp
index 2a3760f..c917b4b 100644
--- a/transaction/LockManager.cpp
+++ b/transaction/LockManager.cpp
@@ -80,21 +80,22 @@ void LockManager::run() {
if (request.getRequestType() == RequestType::kReleaseLocks) {
CHECK(releaseAllLocks(request.getTransactionId()))
<< "Unexpected condition occured.";
-
} else if (acquireLock(request.getTransactionId(),
request.getResourceId(),
request.getAccessMode())) {
+ // Lock has been acquired.
LOG(INFO) << "Transaction "
<< std::to_string(request.getTransactionId())
- << " is waiting " + request.getResourceId().toString();
+ << " acquired " + request.getResourceId().toString();
- inner_pending_requests_.push(request);
+ permitted_requests_.push(request);
} else {
- LOG(INFO) << "Transaction "
- << std::to_string(request.getTransactionId())
- << " acquired " + request.getResourceId().toString();
+ // We are unable to acquire lock at this point.
+ LOG(INFO) << "Transaction "
+ << std::to_string(request.getTransactionId())
+ << " is waiting " + request.getResourceId().toString();
- permitted_requests_.push(request);
+ inner_pending_requests_.push(request);
}
}
}