Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/17097 )
Change subject: KUDU-2612: add PartitionLock and ScopedPartitionLock ...................................................................... Patch Set 5: (3 comments) http://gerrit.cloudera.org:8080/#/c/17097/5/src/kudu/tablet/lock_manager-test.cc File src/kudu/tablet/lock_manager-test.cc: http://gerrit.cloudera.org:8080/#/c/17097/5/src/kudu/tablet/lock_manager-test.cc@261 PS5, Line 261: partition_lock.IsAcquired(&code) Using an already 'moved' variable doesn't smell good. Is it enough just to check for the reference count to make sure the former lock isn't held anymore? http://gerrit.cloudera.org:8080/#/c/17097/5/src/kudu/tablet/lock_manager.cc File src/kudu/tablet/lock_manager.cc: http://gerrit.cloudera.org:8080/#/c/17097/5/src/kudu/tablet/lock_manager.cc@437 PS5, Line 437: if (!txn_id.IsValid()) { : id = std::numeric_limits<int64_t>::max(); : } else { : id = txn_id.value(); : } nit: this might be done using tri-state operator: int64_t id = txn_id.IsValid() ? txn_id.value() : ...; http://gerrit.cloudera.org:8080/#/c/17097/5/src/kudu/tablet/lock_manager.cc@473 PS5, Line 473: PartitionLock* LockManager::WaitUntilAcquiredPartitionLock(const TxnId& txn_id) { What happens when this is running for too long, going over the overall timeout for an operation? In other words, should we add a deadline parameter for this method? -- To view, visit http://gerrit.cloudera.org:8080/17097 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I158115739ce3e7cfb77bbcb854e834336c1256b1 Gerrit-Change-Number: 17097 Gerrit-PatchSet: 5 Gerrit-Owner: Hao Hao <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Andrew Wong <[email protected]> Gerrit-Reviewer: Bankim Bhavsar <[email protected]> Gerrit-Reviewer: Hao Hao <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Tidy Bot (241) Gerrit-Comment-Date: Thu, 11 Mar 2021 20:17:28 +0000 Gerrit-HasComments: Yes
