Skip to content

Commit

Permalink
[clock] add a built-in NTP client implementation
Browse files Browse the repository at this point in the history
This adds a stripped-down implementation of built-in NTP client
without any reliance on the kernel NTP discipline.  This initial
implementation doesn't have all the necessary sanity checks for true
time that RFC-compliant client would have and doesn't implement
everything from RFC5905.  However, this implementation is good enough
for running with well behaved and properly configured reference NTP
servers such as servers from pool.ntp.org, other public-domain NTP
services, and properly configured NTP servers in local network.

This is a first step on the road to eventually have robust and
RFC-compliant Kudu's own NTP client that is able to detect and
reject misbehaving and rogue reference NTP servers.

For Kudu, this should hopefully make it easier for users to configure
NTP even if they don't have root, and also can maintain better clock
error than the system implementation, since we can prioritize low error
bounds rather than low jitter.  This patch doesn't have the knobs
to control error vs jitter yet, though.

This patch also contains tests to verify the newly introduced
functionality in scenarios when the built-in NTP client is pointed
to various combinations of properly configured NTP servers or
unintentionally misconfigured/unavailable ones.

Change-Id: Ieb9eee9f0334236f39617492bd6f01304d1a0255
Reviewed-on: http://gerrit.cloudera.org:8080/7477
Reviewed-by: Adar Dembo <adar@cloudera.com>
Tested-by: Alexey Serbin <aserbin@cloudera.com>
  • Loading branch information
alexeyserbin committed Oct 1, 2019
1 parent fcbca3d commit c103d51
Show file tree
Hide file tree
Showing 5 changed files with 1,651 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/kudu/clock/CMakeLists.txt
Expand Up @@ -16,6 +16,7 @@
# under the License.

set(CLOCK_SRCS
builtin_ntp.cc
hybrid_clock.cc
logical_clock.cc
mock_ntp.cc
Expand Down Expand Up @@ -66,3 +67,4 @@ ADD_KUDU_TEST(logical_clock-test)

SET_KUDU_TEST_LINK_LIBS(clock mini_chronyd mini_chronyd_test_util)
ADD_KUDU_TEST(test/mini_chronyd-test)
ADD_KUDU_TEST(ntp-test)

0 comments on commit c103d51

Please sign in to comment.