Todd Lipcon has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/7221 )

Change subject: Simplify OpId/Timestamp assignment and make it atomic
......................................................................


Patch Set 21:

(2 comments)

Just looked at TransactionDriver first since David asked for a quick review of 
that part

http://gerrit.cloudera.org:8080/#/c/7221/21/src/kudu/tablet/transactions/transaction_driver.cc
File src/kudu/tablet/transactions/transaction_driver.cc:

http://gerrit.cloudera.org:8080/#/c/7221/21/src/kudu/tablet/transactions/transaction_driver.cc@324
PS21, Line 324:         std::lock_guard<simple_spinlock> lock(lock_);
would it be correct here to add a DCHECK_EQ(transaction_->type(), 
consensus::LEADER)? I think so. Maybe would be good doc value.


http://gerrit.cloudera.org:8080/#/c/7221/21/src/kudu/tablet/transactions/transaction_driver.cc@341
PS21, Line 341:  MvccManager::ScopedCleanTimeAdvancePin 
pin(replica->tablet()->mvcc_manager(),
              :                                                    
replica->clock()->Now())
I'm surprised that the clock()->Now() call doesn't need to be made inside of 
the MVCC lock. Otherwise isn't it racey?

T1: call clock->Now()
T2: advance clean time to a higher value
T1: call Pin(older timestamp than current clean time)

.. or are we relying on the fact that there can be no T2 starting a transaction 
at a higher 'Now' because the only thread that starts transactions is the 
prepare thread? Maybe needs some comment on that if it's the case.



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2bedcc5c3708d06f48131f34ea14c835867b4800
Gerrit-Change-Number: 7221
Gerrit-PatchSet: 21
Gerrit-Owner: David Ribeiro Alves <davidral...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com>
Gerrit-Reviewer: David Ribeiro Alves <davidral...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mpe...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <t...@apache.org>
Gerrit-Comment-Date: Wed, 21 Mar 2018 19:53:16 +0000
Gerrit-HasComments: Yes

Reply via email to