Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/17097 )
Change subject: KUDU-2612: add PartitionLock and ScopedPartitionLock ...................................................................... Patch Set 9: (3 comments) http://gerrit.cloudera.org:8080/#/c/17097/6/src/kudu/tablet/lock_manager.h File src/kudu/tablet/lock_manager.h: http://gerrit.cloudera.org:8080/#/c/17097/6/src/kudu/tablet/lock_manager.h@193 PS6, Line 193: > I don't think so, since we only update the reference at the constructor. Bu Yeah, we updated the reference in the constructor, so if copying field-to-field, then the Release() method is called twice: once from the destructor of the original object, and another time from the field-to-field copied object, and the latter is unexpected extra decrease of the reference count. Thank you for addressing this! http://gerrit.cloudera.org:8080/#/c/17097/9/src/kudu/tablet/lock_manager.cc File src/kudu/tablet/lock_manager.cc: http://gerrit.cloudera.org:8080/#/c/17097/9/src/kudu/tablet/lock_manager.cc@460 PS9, Line 460: (MonoDelta::FromMilliseconds(1) This seems to be pretty short timeout. Why just a millisecond? Our timeout aren't strict since this is not a real-time OS anyways. I'd give it 100ms or 250ms at least -- that way it would be much less useless CPU burn and context switching. http://gerrit.cloudera.org:8080/#/c/17097/9/src/kudu/tablet/lock_manager.cc@474 PS9, Line 474: *code = id > partition_lock_->txn_id().value() ? What if by this time the lock has been released by the other party? Will it just crash here with SIGSEGV? -- 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: 9 Gerrit-Owner: Hao Hao <hao....@cloudera.com> Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com> Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com> Gerrit-Reviewer: Bankim Bhavsar <ban...@cloudera.com> Gerrit-Reviewer: Hao Hao <hao....@cloudera.com> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Tidy Bot (241) Gerrit-Comment-Date: Fri, 12 Mar 2021 19:11:21 +0000 Gerrit-HasComments: Yes