Will Berkeley has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/10548 )
Change subject: KUDU-2242 Wait for NTP synchronization on startup ...................................................................... KUDU-2242 Wait for NTP synchronization on startup Sometimes it takes a little while for the clock to be synchronized when a machine first starts up. Occasionally, this causes Kudu to fail to start when the host starts up. This patch allows Kudu to wait for the system clock to become synchronized when using NTP by using either the 'ntp-wait' or the 'chronyc waitsync' utilities. The amount of time to wait is controlled by a new flag --ntp_initial_sync_wait_secs, which defaults to 60. In the common case when the clock is synchronized when Kudu starts, Kudu does not wait (and does not incur the cost of waiting on a subprocess). Waiting can be disabled by setting the new flag to 0. This is hard to test with a unit test, so I manually tested as follows: 1. Restart Kudu on a machine with the clock sync'd. There was no waiting for synchronization. 2. Using both ntpd and chrony, stop the time daemon, set the clock back, and start Kudu, confirming Kudu exited immediately after the wait utilities were unable to contact the daemons. 3. Using both ntpd and chrony, stop the time daemon and Kudu, wait for the clock to be a little out of sync, then start the time daemon and Kudu, confirming that Kudu waited until the clock was in sync and started successfully. Change-Id: I6082c5d35ed0d230d91c61734e7b5a351e50933b Reviewed-on: http://gerrit.cloudera.org:8080/10548 Reviewed-by: Adar Dembo <[email protected]> Tested-by: Will Berkeley <[email protected]> Reviewed-by: Mike Percy <[email protected]> Reviewed-by: Hao Hao <[email protected]> Reviewed-by: Todd Lipcon <[email protected]> --- M src/kudu/clock/system_ntp.cc 1 file changed, 58 insertions(+), 2 deletions(-) Approvals: Adar Dembo: Looks good to me, but someone else must approve Will Berkeley: Verified Mike Percy: Looks good to me, but someone else must approve Hao Hao: Looks good to me, but someone else must approve Todd Lipcon: Looks good to me, approved -- To view, visit http://gerrit.cloudera.org:8080/10548 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I6082c5d35ed0d230d91c61734e7b5a351e50933b Gerrit-Change-Number: 10548 Gerrit-PatchSet: 5 Gerrit-Owner: Will Berkeley <[email protected]> Gerrit-Reviewer: Adar Dembo <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Hao Hao <[email protected]> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Mike Percy <[email protected]> Gerrit-Reviewer: Todd Lipcon <[email protected]> Gerrit-Reviewer: Will Berkeley <[email protected]>
