Andrew Wong has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/16586 )

Change subject: KUDU-2612: add TxnManager::BeginTransaction()
......................................................................


Patch Set 1:

(6 comments)

http://gerrit.cloudera.org:8080/#/c/16586/1/src/kudu/master/txn_manager-test.cc
File src/kudu/master/txn_manager-test.cc:

http://gerrit.cloudera.org:8080/#/c/16586/1/src/kudu/master/txn_manager-test.cc@371
PS1, Line 371: proxy_
Should be 'p'?


http://gerrit.cloudera.org:8080/#/c/16586/1/src/kudu/master/txn_manager-test.cc@374
PS1, Line 374:
nit: spacing?


http://gerrit.cloudera.org:8080/#/c/16586/1/src/kudu/master/txn_manager-test.cc@399
PS1, Line 399:   txn_initiator(kNumTransactions, nullptr);
Would it make sense to also check that we have kNumTransactions transaction IDs 
here?


http://gerrit.cloudera.org:8080/#/c/16586/1/src/kudu/master/txn_manager-test.cc@426
PS1, Line 426: insert
nit: emplace?


http://gerrit.cloudera.org:8080/#/c/16586/1/src/kudu/master/txn_manager.cc
File src/kudu/master/txn_manager.cc:

http://gerrit.cloudera.org:8080/#/c/16586/1/src/kudu/master/txn_manager.cc@119
PS1, Line 119:       while (true) {
             :         if (next_txn_id_.compare_exchange_strong(stored_txn_id, 
try_txn_id + 1) ||
             :             stored_txn_id > try_txn_id) {
             :           break;
             :         }
             :       }
I don't fully understand this. Wouldn't try_txn_id + 1 = next_txn_id_ in the 
common case? If that's the case, isn't this exchange a no-op? Would you mind 
adding a comment explaining this block? I think we should be trying to set 
next_txn_id_ to max(next_txn_id_, stored_txn_id), right?


http://gerrit.cloudera.org:8080/#/c/16586/1/src/kudu/master/txn_manager.cc@134
PS1, Line 134:     if (s.IsNotFound()) {
Maybe not as a part of this patch, but I'm curious whether you think it's worth 
adding a CheckInitialized()-style return here in case we're already trying to 
add a range?



--
To view, visit http://gerrit.cloudera.org:8080/16586
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I51c476d92bb5b147ffd03fd9f3163ab86d581496
Gerrit-Change-Number: 16586
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <aser...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Hao Hao <hao....@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Tue, 13 Oct 2020 00:10:22 +0000
Gerrit-HasComments: Yes

Reply via email to