David Ribeiro Alves has posted comments on this change. Change subject: KUDU-798 (part 4) Add a TimeManager to manage safe time advancement ......................................................................
Patch Set 14: (12 comments) http://gerrit.cloudera.org:8080/#/c/5300/14/src/kudu/consensus/time_manager-test.cc File src/kudu/consensus/time_manager-test.cc: PS14, Line 52: // Waits (forever) for the TimeManager's safe time to have advanced to 'safe_time'. : // Returns a latch that allows to wait for TimeManager to consider 'safe_time' safe. : > the two lines of this comment seem contradictory with each other. The secon Done Line 58: time_manager_->WaitUntilSafe(safe_time, MonoTime::Max()); > should this CHECK_OK? Done Line 94: ASSERT_OK(time_manager_->MessageReceivedFromLeader > weird wrapping Done Line 101: MonoTime after_small = MonoTime::Now(); > I tihnk with recent changes we can just do: Done http://gerrit.cloudera.org:8080/#/c/5300/14/src/kudu/consensus/time_manager.cc File src/kudu/consensus/time_manager.cc: Line 107: Timestamp t(message.timestamp()); > unused? Done Line 170: void TimeManager::AdvanceSafeTimeAndWakeUpWaiters(Timestamp safe_time) { > should this be named 'Unlocked'? Done PS14, Line 190: ( > also unlocked? Done http://gerrit.cloudera.org:8080/#/c/5300/14/src/kudu/consensus/time_manager.h File src/kudu/consensus/time_manager.h: PS14, Line 40: Because of this the read will be repeatable > this probably needs to say something like "If the scanner additionally uses Done PS14, Line 52: sintony > typo? this is a "portuguesism" :P I looked in the dictionary and it seemed to exist :). Done Line 70: TimeManager(scoped_refptr<server::Clock> clock, > nit: no need for wrap Done PS14, Line 95: CHECK failure if it isn't) > curious why the inconsistency that here it's a CHECK failure but above it's because of races in changes of leadership status. consensus might not be leader anymore by the time prepare tries to assign a timestamp so the above shouldn't crash. This one is called on UpdateConsensus() though, so the timemanager should not be in leader mode. PS14, Line 107: 'message's timestamp > 'safe_time' Done -- To view, visit http://gerrit.cloudera.org:8080/5300 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0bb2b1d2590ed7ead6f1980f9572be10444bb81b Gerrit-PatchSet: 14 Gerrit-Project: kudu Gerrit-Branch: master Gerrit-Owner: David Ribeiro Alves <dral...@apache.org> Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com> Gerrit-Reviewer: David Ribeiro Alves <dral...@apache.org> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Mike Percy <mpe...@apache.org> Gerrit-Reviewer: Tidy Bot Gerrit-Reviewer: Todd Lipcon <t...@apache.org> Gerrit-HasComments: Yes