commit | 79bb84893745d330b710fb461e5f89a5d22b324e | [log] [tgz] |
---|---|---|
author | Alexey Serbin <alexey@apache.org> | Wed Oct 25 16:38:21 2023 -0700 |
committer | Alexey Serbin <alexey@apache.org> | Sat Nov 04 14:35:15 2023 +0000 |
tree | acffba18678cc48ddafdfa33ce94ee8812d47738 | |
parent | 6f9abc54eb23a21087004510742f631a6192a523 [diff] |
[clock] KUDU-3521 fix crash when clock is synchronized by PTPd There was an earlier attempt to address the issue [1], but the fix hasn't received +2 since there was not enough evidence behind the root cause analysis. With the report on #kudu-general Slack channel [2], from the analysis of the code [3] it's easy to see there isn't any other way to get such a manifestation of the issue but a negative value for the 'maxerror' field of the 'timex' structure returned by the ntp_adjtime()/adjtimex() system call. The essence of the problem is that in Kudu the maximum error is supposed to be a non-negative number. This patch addresses the issue. [1] https://gerrit.cloudera.org/#/c/12149/ [2] https://getkudu.slack.com/archives/C0CPXJ3CH/p1698246065354269 [3] https://github.com/apache/kudu/blob/04fdbd0974f4418295d57c0daa4b67de3e777a43/src/kudu/clock/hybrid_clock.cc#L627-L706 Change-Id: Ibbe1a50c4857b9742d2ffde35440d0dee082edc0 Reviewed-on: http://gerrit.cloudera.org:8080/20626 Tested-by: Kudu Jenkins Reviewed-by: Yingchun Lai <laiyingchun@apache.org> Reviewed-by: Abhishek Chennaka <achennaka@cloudera.com> (cherry picked from commit 4859d290277bf36f0bd84891c4764194c2cf9521) Conflicts: src/kudu/clock/system_ntp.cc Reviewed-on: http://gerrit.cloudera.org:8080/20650