You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Todd Lipcon (Code Review)" <ge...@cloudera.org> on 2017/07/27 04:26:50 UTC
[kudu-CR] WIP: clock: refactor interaction with NTP into a new interface
Todd Lipcon has uploaded a new change for review.
http://gerrit.cloudera.org:8080/7520
Change subject: WIP: clock: refactor interaction with NTP into a new interface
......................................................................
WIP: clock: refactor interaction with NTP into a new interface
Change-Id: If0653ec32016c588fb63c74f7bc962593aa6c4a0
---
M src/kudu/clock/CMakeLists.txt
M src/kudu/clock/hybrid_clock-test.cc
M src/kudu/clock/hybrid_clock.cc
M src/kudu/clock/hybrid_clock.h
A src/kudu/clock/mock_ntp.cc
A src/kudu/clock/mock_ntp.h
A src/kudu/clock/ntp_source.h
A src/kudu/clock/system_ntp.cc
A src/kudu/clock/system_ntp.h
M src/kudu/integration-tests/consistency-itest.cc
M src/kudu/integration-tests/tablet_history_gc-itest.cc
M src/kudu/server/generic_service.cc
M src/kudu/server/server_base.proto
M src/kudu/tablet/tablet_history_gc-test.cc
14 files changed, 400 insertions(+), 179 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/20/7520/1
--
To view, visit http://gerrit.cloudera.org:8080/7520
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If0653ec32016c588fb63c74f7bc962593aa6c4a0
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
[kudu-CR] clock: refactor interaction with NTP into a new interface
Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change.
Change subject: clock: refactor interaction with NTP into a new interface
......................................................................
Patch Set 4:
(4 comments)
http://gerrit.cloudera.org:8080/#/c/7520/4/src/kudu/clock/mock_ntp.h
File src/kudu/clock/mock_ntp.h:
Line 42: return 500;
Doc this magic value.
http://gerrit.cloudera.org:8080/#/c/7520/4/src/kudu/clock/system_ntp.cc
File src/kudu/clock/system_ntp.cc:
Anything in here that wasn't straight-up code motion from hybrid_clock.cc?
Line 25: #include <sys/timex.h>
Should precede everything but system_ntp.h
http://gerrit.cloudera.org:8080/#/c/7520/4/src/kudu/clock/time_service.h
File src/kudu/clock/time_service.h:
PS4, Line 49: true
Maybe "actual" to avoid conflation with Google's TrueTime?
--
To view, visit http://gerrit.cloudera.org:8080/7520
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: If0653ec32016c588fb63c74f7bc962593aa6c4a0
Gerrit-PatchSet: 4
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: Yes
[kudu-CR] clock: refactor interaction with NTP into a new interface
Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change.
Change subject: clock: refactor interaction with NTP into a new interface
......................................................................
Patch Set 5:
(1 comment)
http://gerrit.cloudera.org:8080/#/c/7520/5/src/kudu/clock/mock_ntp.cc
File src/kudu/clock/mock_ntp.cc:
Line 21: #include "kudu/util/locks.h"
Er, what happened here?
--
To view, visit http://gerrit.cloudera.org:8080/7520
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: If0653ec32016c588fb63c74f7bc962593aa6c4a0
Gerrit-PatchSet: 5
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: Yes
[kudu-CR] clock: refactor interaction with NTP into a new interface
Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/7520
to look at the new patch set (#6).
Change subject: clock: refactor interaction with NTP into a new interface
......................................................................
clock: refactor interaction with NTP into a new interface
This refactors HybridClock to interact with the system NTP service (or
its mock) via a new TimeService interface. This encapsulates the
NTP-specific code in such a way that we can easily swap it out with a
built-in NTP client implementation in a future patch.
This also cleans up the 'mock' and OSX (unsynchronized) clock mode to
simply be new implementations of the above interface.
Change-Id: If0653ec32016c588fb63c74f7bc962593aa6c4a0
---
M src/kudu/clock/CMakeLists.txt
M src/kudu/clock/hybrid_clock-test.cc
M src/kudu/clock/hybrid_clock.cc
M src/kudu/clock/hybrid_clock.h
A src/kudu/clock/mock_ntp.cc
A src/kudu/clock/mock_ntp.h
A src/kudu/clock/system_ntp.cc
A src/kudu/clock/system_ntp.h
A src/kudu/clock/system_unsync_time.cc
A src/kudu/clock/system_unsync_time.h
A src/kudu/clock/time_service.h
M src/kudu/integration-tests/consistency-itest.cc
M src/kudu/integration-tests/tablet_history_gc-itest.cc
M src/kudu/server/generic_service.cc
M src/kudu/server/server_base.proto
M src/kudu/tablet/tablet_history_gc-test.cc
16 files changed, 534 insertions(+), 179 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/20/7520/6
--
To view, visit http://gerrit.cloudera.org:8080/7520
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If0653ec32016c588fb63c74f7bc962593aa6c4a0
Gerrit-PatchSet: 6
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
[kudu-CR] clock: refactor interaction with NTP into a new interface
Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has posted comments on this change.
Change subject: clock: refactor interaction with NTP into a new interface
......................................................................
Patch Set 5:
(1 comment)
http://gerrit.cloudera.org:8080/#/c/7520/5/src/kudu/clock/mock_ntp.cc
File src/kudu/clock/mock_ntp.cc:
Line 21: #include "kudu/util/locks.h"
> Er, what happened here?
erg, I somehow managed to revert backward half of my changes... not sure where I went wrong in my gittery
--
To view, visit http://gerrit.cloudera.org:8080/7520
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: If0653ec32016c588fb63c74f7bc962593aa6c4a0
Gerrit-PatchSet: 5
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: Yes
[kudu-CR] clock: refactor interaction with NTP into a new interface
Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/7520
to look at the new patch set (#5).
Change subject: clock: refactor interaction with NTP into a new interface
......................................................................
clock: refactor interaction with NTP into a new interface
This refactors HybridClock to interact with the system NTP service (or
its mock) via a new TimeService interface. This encapsulates the
NTP-specific code in such a way that we can easily swap it out with a
built-in NTP client implementation in a future patch.
This also cleans up the 'mock' and OSX (unsynchronized) clock mode to
simply be new implementations of the above interface.
Change-Id: If0653ec32016c588fb63c74f7bc962593aa6c4a0
---
M src/kudu/clock/CMakeLists.txt
M src/kudu/clock/hybrid_clock-test.cc
M src/kudu/clock/hybrid_clock.cc
M src/kudu/clock/hybrid_clock.h
A src/kudu/clock/mock_ntp.cc
A src/kudu/clock/mock_ntp.h
A src/kudu/clock/system_ntp.cc
A src/kudu/clock/system_ntp.h
A src/kudu/clock/system_unsync_time.cc
A src/kudu/clock/system_unsync_time.h
A src/kudu/clock/time_service.h
M src/kudu/integration-tests/consistency-itest.cc
M src/kudu/integration-tests/tablet_history_gc-itest.cc
M src/kudu/server/generic_service.cc
M src/kudu/server/server_base.proto
M src/kudu/tablet/tablet_history_gc-test.cc
16 files changed, 534 insertions(+), 179 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/20/7520/5
--
To view, visit http://gerrit.cloudera.org:8080/7520
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If0653ec32016c588fb63c74f7bc962593aa6c4a0
Gerrit-PatchSet: 5
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
[kudu-CR] clock: refactor interaction with NTP into a new interface
Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has posted comments on this change.
Change subject: clock: refactor interaction with NTP into a new interface
......................................................................
Patch Set 4:
(6 comments)
I also realized that this patch will break builds on OSX so I'll do another rev before committable.
http://gerrit.cloudera.org:8080/#/c/7520/4/src/kudu/clock/mock_ntp.h
File src/kudu/clock/mock_ntp.h:
Line 42: return 500;
> Doc this magic value.
Done
http://gerrit.cloudera.org:8080/#/c/7520/4/src/kudu/clock/system_ntp.cc
File src/kudu/clock/system_ntp.cc:
> Anything in here that wasn't straight-up code motion from hybrid_clock.cc?
not really, will add a comment or two on the only spots I did some manual changes.
Line 25: #include <sys/timex.h>
> Should precede everything but system_ntp.h
Done
Line 95: skew_ppm_ = timex.tolerance / kAdjtimexScalingFactor;
This was changed a bit from the original code. Originally in hybrid_clock we had:
tolerance_adjustment_ = (1 + ((timex.tolerance / kAdjtimexScalingFactor) / 1000000.0));
but now instead of storing this 'adjustment factor' it's just storing the PPM value, and the 'adjustment factor' is calculated on the spot in hybrid_clock.cc:
// Additionally adjust the sleep time with the max tolerance adjustment
// to account for the worst case clock skew while we're sleeping.
wait_for_usec *= (1 + (time_service_->skew_ppm() / 1000000.0));
Line 98: << " Skew PPM: " << skew_ppm_
Change: we used to log the 'tolerance adjustment' factor here, but now log the PPM.
http://gerrit.cloudera.org:8080/#/c/7520/4/src/kudu/clock/time_service.h
File src/kudu/clock/time_service.h:
PS4, Line 49: true
> Maybe "actual" to avoid conflation with Google's TrueTime?
Done
--
To view, visit http://gerrit.cloudera.org:8080/7520
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: If0653ec32016c588fb63c74f7bc962593aa6c4a0
Gerrit-PatchSet: 4
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: Yes
[kudu-CR] clock: refactor interaction with NTP into a new interface
Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has posted comments on this change.
Change subject: clock: refactor interaction with NTP into a new interface
......................................................................
Patch Set 3:
(2 comments)
fixed new tidy issues
http://gerrit.cloudera.org:8080/#/c/7520/3/src/kudu/clock/hybrid_clock-test.cc
File src/kudu/clock/hybrid_clock-test.cc:
Line 22: #include "kudu/clock/mock_ntp.h"
> warning: #includes are not sorted properly [llvm-include-order]
Done
http://gerrit.cloudera.org:8080/#/c/7520/3/src/kudu/clock/mock_ntp.cc
File src/kudu/clock/mock_ntp.cc:
Line 20: #include "kudu/util/status.h"
> warning: #includes are not sorted properly [llvm-include-order]
Done
--
To view, visit http://gerrit.cloudera.org:8080/7520
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: If0653ec32016c588fb63c74f7bc962593aa6c4a0
Gerrit-PatchSet: 3
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: Yes
[kudu-CR] clock: refactor interaction with NTP into a new interface
Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change.
Change subject: clock: refactor interaction with NTP into a new interface
......................................................................
Patch Set 6: Code-Review+2
--
To view, visit http://gerrit.cloudera.org:8080/7520
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: If0653ec32016c588fb63c74f7bc962593aa6c4a0
Gerrit-PatchSet: 6
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: No
[kudu-CR] clock: refactor interaction with NTP into a new interface
Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/7520
to look at the new patch set (#3).
Change subject: clock: refactor interaction with NTP into a new interface
......................................................................
clock: refactor interaction with NTP into a new interface
Change-Id: If0653ec32016c588fb63c74f7bc962593aa6c4a0
---
M src/kudu/clock/CMakeLists.txt
M src/kudu/clock/hybrid_clock-test.cc
M src/kudu/clock/hybrid_clock.cc
M src/kudu/clock/hybrid_clock.h
A src/kudu/clock/mock_ntp.cc
A src/kudu/clock/mock_ntp.h
A src/kudu/clock/system_ntp.cc
A src/kudu/clock/system_ntp.h
A src/kudu/clock/time_service.h
M src/kudu/integration-tests/consistency-itest.cc
M src/kudu/integration-tests/tablet_history_gc-itest.cc
M src/kudu/server/generic_service.cc
M src/kudu/server/server_base.proto
M src/kudu/tablet/tablet_history_gc-test.cc
14 files changed, 439 insertions(+), 180 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/20/7520/3
--
To view, visit http://gerrit.cloudera.org:8080/7520
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If0653ec32016c588fb63c74f7bc962593aa6c4a0
Gerrit-PatchSet: 3
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Tidy Bot
[kudu-CR] clock: refactor interaction with NTP into a new interface
Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/7520
to look at the new patch set (#4).
Change subject: clock: refactor interaction with NTP into a new interface
......................................................................
clock: refactor interaction with NTP into a new interface
Change-Id: If0653ec32016c588fb63c74f7bc962593aa6c4a0
---
M src/kudu/clock/CMakeLists.txt
M src/kudu/clock/hybrid_clock-test.cc
M src/kudu/clock/hybrid_clock.cc
M src/kudu/clock/hybrid_clock.h
A src/kudu/clock/mock_ntp.cc
A src/kudu/clock/mock_ntp.h
A src/kudu/clock/system_ntp.cc
A src/kudu/clock/system_ntp.h
A src/kudu/clock/time_service.h
M src/kudu/integration-tests/consistency-itest.cc
M src/kudu/integration-tests/tablet_history_gc-itest.cc
M src/kudu/server/generic_service.cc
M src/kudu/server/server_base.proto
M src/kudu/tablet/tablet_history_gc-test.cc
14 files changed, 439 insertions(+), 180 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/20/7520/4
--
To view, visit http://gerrit.cloudera.org:8080/7520
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If0653ec32016c588fb63c74f7bc962593aa6c4a0
Gerrit-PatchSet: 4
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
[kudu-CR] WIP: clock: refactor interaction with NTP into a new interface
Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/7520
to look at the new patch set (#2).
Change subject: WIP: clock: refactor interaction with NTP into a new interface
......................................................................
WIP: clock: refactor interaction with NTP into a new interface
Change-Id: If0653ec32016c588fb63c74f7bc962593aa6c4a0
---
M src/kudu/clock/CMakeLists.txt
M src/kudu/clock/hybrid_clock-test.cc
M src/kudu/clock/hybrid_clock.cc
M src/kudu/clock/hybrid_clock.h
A src/kudu/clock/mock_ntp.cc
A src/kudu/clock/mock_ntp.h
A src/kudu/clock/ntp_source.h
A src/kudu/clock/system_ntp.cc
A src/kudu/clock/system_ntp.h
M src/kudu/integration-tests/consistency-itest.cc
M src/kudu/integration-tests/tablet_history_gc-itest.cc
M src/kudu/server/generic_service.cc
M src/kudu/server/server_base.proto
M src/kudu/tablet/tablet_history_gc-test.cc
14 files changed, 400 insertions(+), 179 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/20/7520/2
--
To view, visit http://gerrit.cloudera.org:8080/7520
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If0653ec32016c588fb63c74f7bc962593aa6c4a0
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Tidy Bot
[kudu-CR] clock: refactor interaction with NTP into a new interface
Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has submitted this change and it was merged.
Change subject: clock: refactor interaction with NTP into a new interface
......................................................................
clock: refactor interaction with NTP into a new interface
This refactors HybridClock to interact with the system NTP service (or
its mock) via a new TimeService interface. This encapsulates the
NTP-specific code in such a way that we can easily swap it out with a
built-in NTP client implementation in a future patch.
This also cleans up the 'mock' and OSX (unsynchronized) clock mode to
simply be new implementations of the above interface.
Change-Id: If0653ec32016c588fb63c74f7bc962593aa6c4a0
Reviewed-on: http://gerrit.cloudera.org:8080/7520
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <ad...@cloudera.com>
---
M src/kudu/clock/CMakeLists.txt
M src/kudu/clock/hybrid_clock-test.cc
M src/kudu/clock/hybrid_clock.cc
M src/kudu/clock/hybrid_clock.h
A src/kudu/clock/mock_ntp.cc
A src/kudu/clock/mock_ntp.h
A src/kudu/clock/system_ntp.cc
A src/kudu/clock/system_ntp.h
A src/kudu/clock/system_unsync_time.cc
A src/kudu/clock/system_unsync_time.h
A src/kudu/clock/time_service.h
M src/kudu/integration-tests/consistency-itest.cc
M src/kudu/integration-tests/tablet_history_gc-itest.cc
M src/kudu/server/generic_service.cc
M src/kudu/server/server_base.proto
M src/kudu/tablet/tablet_history_gc-test.cc
16 files changed, 534 insertions(+), 179 deletions(-)
Approvals:
Adar Dembo: Looks good to me, approved
Kudu Jenkins: Verified
--
To view, visit http://gerrit.cloudera.org:8080/7520
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If0653ec32016c588fb63c74f7bc962593aa6c4a0
Gerrit-PatchSet: 7
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>