You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kudu.apache.org by "Jean-Daniel Cryans (Code Review)" <ge...@cloudera.org> on 2016/03/02 05:32:27 UTC

[kudu-CR](branch-0.7.x) KUDU-1345. Fix case in which hybrid clock can run backwards

Hello David Ribeiro Alves, Adar Dembo, Kudu Jenkins,

I'd like you to do a code review.  Please visit

    http://gerrit.cloudera.org:8080/2393

to review the following change.

Change subject: KUDU-1345. Fix case in which hybrid clock can run backwards
......................................................................

KUDU-1345. Fix case in which hybrid clock can run backwards

This fixes a bug with the following sequence of updates:

- the clock is at time (phys=1000, logical=0)
- we get an update from the future: (phys=1100, logical=0)
- we generate clock reads locally thousands of times, which causes the
  logical value to wrap into the physical value (phys=1105, logical=0)
- our physical clock advances to (phys=1101, logical=0)

Previously, we would incorrectly move the clock backwards to (1101, 0)
because the physical value was higher than the last external update.
This is obviously incorrect.

The fix simplifies the logic in the hybrid clock to just maintain a single
timestamp, rather than separately tracking the last logical and physical
time.

Change-Id: I9b4a04cb8b7b5eb879d017375714b3183be0c601
Reviewed-on: http://gerrit.cloudera.org:8080/2266
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <ad...@cloudera.com>
Reviewed-by: David Ribeiro Alves <da...@cloudera.com>
---
M src/kudu/server/hybrid_clock-test.cc
M src/kudu/server/hybrid_clock.cc
M src/kudu/server/hybrid_clock.h
3 files changed, 70 insertions(+), 29 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/93/2393/1
-- 
To view, visit http://gerrit.cloudera.org:8080/2393
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9b4a04cb8b7b5eb879d017375714b3183be0c601
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: branch-0.7.x
Gerrit-Owner: Jean-Daniel Cryans
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: David Ribeiro Alves <da...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>