You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Alexey Serbin (Code Review)" <ge...@cloudera.org> on 2020/02/05 02:15:37 UTC

[kudu-CR] [clock] auto-selection of time source

Alexey Serbin has uploaded this change for review. ( http://gerrit.cloudera.org:8080/15161


Change subject: [clock] auto-selection of time source
......................................................................

[clock] auto-selection of time source

This patch introduces a new time source named 'auto'.  When
--time_source flag is set to 'auto', the system's behaves is the
following:

  * If the host is of known cloud instance type that provides
    a dedicated NTP server, the time source is set to 'builtin'.

  * If the host is of known cloud instance type that doesn't provide
    a dedicated NTP server or the host is not recognized as a cloud
    instance, the time source is set to 'system'
    (if 'system' time source is supported, otherwise set to
     'system_unsync').

In former case, if the --builtin_ntp_client_enable_auto_config_in_cloud
flag is set to 'true', the built-in NTP client is configured to use
the dedicated NTP server provided by the cloud platform.

Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
---
M src/kudu/clock/hybrid_clock-test.cc
M src/kudu/clock/hybrid_clock.cc
M src/kudu/util/cloud/instance_metadata.cc
M src/kudu/util/cloud/instance_metadata.h
4 files changed, 63 insertions(+), 8 deletions(-)



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>

[kudu-CR] [clock] introduce time source auto selection

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Hello Tidy Bot, Attila Bukor, Kudu Jenkins, Adar Dembo, Grant Henke, Greg Solovyev, Volodymyr Verovkin, Hao Hao, Bankim Bhavsar, 

I'd like you to reexamine a change. Please visit

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

to look at the new patch set (#10).

Change subject: [clock] introduce time source auto selection
......................................................................

[clock] introduce time source auto selection

This patch introduces a new pseudo time source named 'auto'.  When
the --time_source flag is set to 'auto', Kudu masters and tablet
servers automatically select the most appropriate time source for
the hybrid clock (see below for the rationale behind the choice).

Below are the rules for the time source auto-selection:

  * AWS and GCE cloud environments: the 'builtin' time source is
    used (i.e. the hybrid clock uses the built-in NTP client) and
    the built-in NTP client is configured to use the dedicated NTP
    server provided by the environment

  * Azure cloud environments, not-yet-supported cloud environments,
    and non-cloud machines: the 'system' time source is used
    (i.e. the hybrid clock uses NTP-synchronized local clock)

  * macOS machines:
      ** High Sierra 10.13 and newer: 'system'
      ** releases prior to High Sierra: 'system_unsync'

As for the rationale behind auto-selecting this or another time source:

  * when NTP servers are not known beforehand or their high availability
    is not guaranteed, relying on the local NTP-synchronized clock is
    the only rational choice (and it's backward-compatible)

  * when it's guaranteed to have a set of highly available NTP servers,
    using the built-in NTP client is the best choice because it removes
    the requirement to configure and maintain NTP server at the machine

NOTE: this patch essentially removes the functionality introduced in
      69cf2065805163799d85dc38b812eb73388d3a02 (i.e. auto-configuration
      of the built-in NTP client), so now automatic configuration of the
      built-in NTP client is not available outside of the
      --time_source=auto context.

Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
---
M src/kudu/clock/builtin_ntp.cc
M src/kudu/clock/builtin_ntp.h
M src/kudu/clock/hybrid_clock-test.cc
M src/kudu/clock/hybrid_clock.cc
M src/kudu/clock/hybrid_clock.h
M src/kudu/mini-cluster/external_mini_cluster-test.cc
6 files changed, 274 insertions(+), 126 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/61/15161/10
-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 10
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Greg Solovyev <gs...@cloudera.com>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>

[kudu-CR] [clock] introduce time source auto selection

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/15161 )

Change subject: [clock] introduce time source auto selection
......................................................................


Patch Set 6:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/15161/6/src/kudu/clock/hybrid_clock.cc
File src/kudu/clock/hybrid_clock.cc:

http://gerrit.cloudera.org:8080/#/c/15161/6/src/kudu/clock/hybrid_clock.cc@416
PS6, Line 416:         result_builtin_ntp_servers.emplace_back(ntp_server,
             :                                                 clock::kStandardNtpPort);
> I don't like the idea of passing parameters via global variables.  That's w
Agreed with the global variable sentiment, but worth pointing out that there's a difference between changing the _value_ of a gflag, and changing its _default value_. I think the latter is perfectly reasonable as it still allows the user to provide their own value and override whatever we've chosen when we changed the default value.

To summarize, the priority order is:
1. user-provided value, which takes precedence over
2. dynamic default value (chosen at runtime), which takes precedence over
3. static default value (baked into the code).


http://gerrit.cloudera.org:8080/#/c/15161/6/src/kudu/clock/hybrid_clock.cc@428
PS6, Line 428:     if (result_time_source == TimeSource::UNKNOWN) {
             :       // The fallback to TimeSource::SYSTEM_UNSYNC is possible only when
             :       // it's explicitly allowed by --time_source_system_unsync_allowed flag.
             :       if (!FLAGS_time_source_system_unsync_allowed) {
             :         return Status::InvalidArgument(
             :             "no viable time source to auto-select: in a test environment "
             :             "consider setting --time_source_system_unsync_allowed");
             :       }
             :       result_time_source = TimeSource::SYSTEM_UNSYNC;
> Apart from this particular piece, I thought about introducing the --time_so
I guess what you want is to be able to tag a particular gflag _value_ as unsafe (rather than tagging the entire gflag). And then you'd tag "system_unsync' in this way, forcing people to use --unlock_unsafe_flags.

Maybe you could get that same effect using a group vaiidator for --time_source, without introducing a brand new gflag?



-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 6
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>
Gerrit-Comment-Date: Fri, 07 Feb 2020 22:46:59 +0000
Gerrit-HasComments: Yes

[kudu-CR] [clock] introduce time source auto selection

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/15161 )

Change subject: [clock] introduce time source auto selection
......................................................................


Patch Set 6:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/15161/6/src/kudu/clock/hybrid_clock.cc
File src/kudu/clock/hybrid_clock.cc:

http://gerrit.cloudera.org:8080/#/c/15161/6/src/kudu/clock/hybrid_clock.cc@416
PS6, Line 416:         result_builtin_ntp_servers.emplace_back(ntp_server,
             :                                                 clock::kStandardNtpPort);
> Agreed with the global variable sentiment, but worth pointing out that ther
This sounds reasonable.  I'll set the default value for the glfag then.  Thanks.


http://gerrit.cloudera.org:8080/#/c/15161/6/src/kudu/clock/hybrid_clock.cc@428
PS6, Line 428:     if (result_time_source == TimeSource::UNKNOWN) {
             :       // The fallback to TimeSource::SYSTEM_UNSYNC is possible only when
             :       // it's explicitly allowed by --time_source_system_unsync_allowed flag.
             :       if (!FLAGS_time_source_system_unsync_allowed) {
             :         return Status::InvalidArgument(
             :             "no viable time source to auto-select: in a test environment "
             :             "consider setting --time_source_system_unsync_allowed");
             :       }
             :       result_time_source = TimeSource::SYSTEM_UNSYNC;
> I guess what you want is to be able to tag a particular gflag _value_ as un
Indeed, the need is to mark a particular gflag value as unsafe.

I think using the group validator for that purpose is a great idea.  Thanks!



-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 6
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>
Gerrit-Comment-Date: Fri, 07 Feb 2020 23:11:15 +0000
Gerrit-HasComments: Yes

[kudu-CR] [clock] introduce time source auto selection

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/15161 )

Change subject: [clock] introduce time source auto selection
......................................................................


Patch Set 8:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/15161/8/src/kudu/clock/hybrid_clock.cc
File src/kudu/clock/hybrid_clock.cc:

http://gerrit.cloudera.org:8080/#/c/15161/8/src/kudu/clock/hybrid_clock.cc@433
PS8, Line 433:       if (clock::BuiltInNtp::auto_configuration_enabled()) {
I still don't see the use case for --time_source=auto with --builtin_ntp_enable_auto_config=false.

When I asked about this earlier, you said "I don't think --time_source=auto should imply --builtin_ntp_client_enable_auto_config_in_cloud=true: otherwise, there is no way to auto-detect the source and use the custom settings for the --builtin_ntp_servers flag". If a user is going to customize the list of built-in servers, isn't it reasonable to ask them to also set --time_source=builtin?

This goes back to my thesis that --time_source=auto and --builtin_ntp_enable_auto_config feel duplicative: I haven't yet been convinced that their separation enables different important use cases. And if we combined them, we could guarantee just one  InstanceDetector (in HybridClock), addressing my other concern that it'll be hard to ensure that, if there are multiple InstanceDetectors in the code, only one is active.

- Problem: you're running on a cloud environment with --time_source=builtin and you're unhappy with the remote nature of the default NTP servers. Solution: you switch to --time_source=auto.
- Problem: you're running on a cloud environment with --time_source=auto, you're unhappy with AWS/GCE NTP and want to further customize your NTP servers. Solution: you switch to --time_source=builtin and modify --builtin_ntp_servers.
- Problem: you're running on a cloud environment with --time_source=system and your local machine isn't configured to synchronize well. Solution: you switch to --time_source=auto.

Feel free to add/modify the above to prove your argument.


http://gerrit.cloudera.org:8080/#/c/15161/8/src/kudu/clock/hybrid_clock.cc@450
PS8, Line 450: back
back to



-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 8
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>
Gerrit-Comment-Date: Wed, 12 Feb 2020 05:49:41 +0000
Gerrit-HasComments: Yes

[kudu-CR] [clock] introduce time source auto selection

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/15161 )

Change subject: [clock] introduce time source auto selection
......................................................................


Patch Set 4:

unrelated test failure:
  * RELEASE: https://issues.apache.org/jira/browse/KUDU-3051


-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 4
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>
Gerrit-Comment-Date: Fri, 07 Feb 2020 05:51:48 +0000
Gerrit-HasComments: No

[kudu-CR] [clock] introduce time source auto selection

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/15161 )

Change subject: [clock] introduce time source auto selection
......................................................................


Patch Set 1:

(5 comments)

http://gerrit.cloudera.org:8080/#/c/15161/1/src/kudu/clock/hybrid_clock.cc
File src/kudu/clock/hybrid_clock.cc:

http://gerrit.cloudera.org:8080/#/c/15161/1/src/kudu/clock/hybrid_clock.cc@175
PS1, Line 175:     const auto s = detector.Detect(&md);
> I'm still finding it really difficult to reason about when the HybridClock 
Sure, I'll add that into the commit message.

As a summary, for the auto-selection of the time source and the auto-detection of the NTP server for the built-in NTP client there are two orthogonal flags:
  * --time_source=auto for the former
  * --builtin_ntp_client_enable_auto_config_in_cloud=true for the latter


http://gerrit.cloudera.org:8080/#/c/15161/6/src/kudu/clock/hybrid_clock.cc
File src/kudu/clock/hybrid_clock.cc:

http://gerrit.cloudera.org:8080/#/c/15161/6/src/kudu/clock/hybrid_clock.cc@91
PS6, Line 91:   }
> Looks a bit cryptic. I suggest to replace macro with text (here and below).
The idea was to avoid using string literals, but use constants (helps with getting away from typo-style mistakes).


http://gerrit.cloudera.org:8080/#/c/15161/6/src/kudu/clock/hybrid_clock.cc@416
PS6, Line 416:   if (now > then) {
             :     return Status::OK();
> An alternative to passing the builtin servers back and forth is, in this ca
I don't like the idea of passing parameters via global variables.  That's why I decided to go this route.]

Also, I'd like to keep the values of those flags as they are set by user (that's for reporting on chosen parameters, etc.).


http://gerrit.cloudera.org:8080/#/c/15161/6/src/kudu/clock/hybrid_clock.cc@428
PS6, Line 428: 
             : bool HybridClock::IsAfter(Timestamp t) {
             :   // Manually get the time, rather than using Now(), so we don't end up causing
             :   // a time update.
             :   uint64_t now_usec;
             :   uint64_t error_usec;
             :   WalltimeWithErrorOrDie(&now_usec, &error_usec);
             : 
             :   Timestamp now;
> In practice, we only wind up here on older versions of macOS, right? I don'
Apart from this particular piece, I thought about introducing the --time_source_system_unsync_allowed flag anyways: I think there should be explicit guardrail to prevent people using the 'system_unsync' time source in production.

If necessary, I can move the introduction of the --time_source_system_unsync_allowed flag into a separate changelist.

What do you think?


http://gerrit.cloudera.org:8080/#/c/15161/6/src/kudu/clock/hybrid_clock.cc@466
PS6, Line 466:     //  A         B          C
> Should it be wrapped into #if defined(KUDU_HAS_SYSTEM_TIME_SOURCE) ?
I think there is no need for that.  This is just an utility to convert enum values into strings, it shouldn't be affected by the availability of the 'system' time source.



-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>
Gerrit-Comment-Date: Fri, 07 Feb 2020 22:26:19 +0000
Gerrit-HasComments: Yes

[kudu-CR] [clock] introduce time source auto selection

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Hello Tidy Bot, Kudu Jenkins, Adar Dembo, Grant Henke, Volodymyr Verovkin, 

I'd like you to reexamine a change. Please visit

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

to look at the new patch set (#5).

Change subject: [clock] introduce time source auto selection
......................................................................

[clock] introduce time source auto selection

This patch introduces a new time source named 'auto'.  When the
--time_source flag is set to 'auto', the system behaves as the
following:

  * If the host is of known cloud instance type that provides
    a dedicated NTP server, the time source is set to 'builtin'.

  * If the host is of known cloud instance type that doesn't provide
    a dedicated NTP server or the host is not recognized as a cloud
    instance, the time source is set to 'system'.

In the former case, since --builtin_ntp_client_enable_auto_config_in_cloud
is set to 'true' by default, the built-in NTP client is configured
to use the dedicated NTP server provided by the cloud platform.  To
disable the auto-configuration of the built-in NTP client and use
custom list of NTP servers specified by the --builtin_ntp_servers flag,
set --builtin_ntp_client_enable_auto_config_in_cloud=false.

Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
---
M src/kudu/client/client_examples-test.sh
M src/kudu/clock/builtin_ntp.cc
M src/kudu/clock/builtin_ntp.h
M src/kudu/clock/hybrid_clock-test.cc
M src/kudu/clock/hybrid_clock.cc
M src/kudu/clock/hybrid_clock.h
M src/kudu/mini-cluster/external_mini_cluster.cc
M src/kudu/util/test_util.cc
8 files changed, 289 insertions(+), 82 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/61/15161/5
-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 5
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>

[kudu-CR] [clock] introduce time source auto selection

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/15161 )

Change subject: [clock] introduce time source auto selection
......................................................................


Patch Set 6:

(4 comments)

http://gerrit.cloudera.org:8080/#/c/15161/1//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/15161/1//COMMIT_MSG@10
PS1, Line 10: haves a
behavior


http://gerrit.cloudera.org:8080/#/c/15161/1/src/kudu/clock/hybrid_clock.cc
File src/kudu/clock/hybrid_clock.cc:

http://gerrit.cloudera.org:8080/#/c/15161/1/src/kudu/clock/hybrid_clock.cc@175
PS1, Line 175:         wait_for_usec, us_until_deadline));
> I changed the default for --builtin_ntp_client_enable_auto_config_in_cloud 
I'm still finding it really difficult to reason about when the HybridClock cloud detector runs, and when the BuiltInNtp detector runs, and whether they ever both run. Moreover, I'm finding it hard to figure out exactly what all the knobs are, which ones the user is likely to use, which ones they aren't, and whether we've achieved the right level of flexibility here (or whether we've overengineered).

Could you add a summary description of the gflags and their interactions to the commit message? You can ignore the ones that affect some small aspect of a time source (like --builtin_ntp_true_time_refresh_max_interval_s) and focus on just the ones that affect time source selection and, for the built-in NTP client, NTP server selection.


http://gerrit.cloudera.org:8080/#/c/15161/6/src/kudu/clock/hybrid_clock.cc
File src/kudu/clock/hybrid_clock.cc:

http://gerrit.cloudera.org:8080/#/c/15161/6/src/kudu/clock/hybrid_clock.cc@416
PS6, Line 416:         result_builtin_ntp_servers.emplace_back(ntp_server,
             :                                                 clock::kStandardNtpPort);
An alternative to passing the builtin servers back and forth is, in this case (i.e. when we've detected the cloud provider and we know we should use an alternate NTP server), to use the gflag API to change the default value of --builtin_ntp_servers to whatever we want it to be. That should reduce the amount of work in the code that follows.


http://gerrit.cloudera.org:8080/#/c/15161/6/src/kudu/clock/hybrid_clock.cc@428
PS6, Line 428:     if (result_time_source == TimeSource::UNKNOWN) {
             :       // The fallback to TimeSource::SYSTEM_UNSYNC is possible only when
             :       // it's explicitly allowed by --time_source_system_unsync_allowed flag.
             :       if (!FLAGS_time_source_system_unsync_allowed) {
             :         return Status::InvalidArgument(
             :             "no viable time source to auto-select: in a test environment "
             :             "consider setting --time_source_system_unsync_allowed");
             :       }
             :       result_time_source = TimeSource::SYSTEM_UNSYNC;
In practice, we only wind up here on older versions of macOS, right? I don't think we need --time_source_system_unsync_allowed for them; I think we can drop the gflag and just choose SYSTEM_UNSYNC unconditionally for such cases. Let's just make sure we LOG the chosen time source in the 'auto' case.



-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 6
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>
Gerrit-Comment-Date: Fri, 07 Feb 2020 20:44:11 +0000
Gerrit-HasComments: Yes

[kudu-CR] [clock] auto-selection of time source

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/15161 )

Change subject: [clock] auto-selection of time source
......................................................................


Patch Set 1:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/15161/1/src/kudu/clock/hybrid_clock.cc
File src/kudu/clock/hybrid_clock.cc:

http://gerrit.cloudera.org:8080/#/c/15161/1/src/kudu/clock/hybrid_clock.cc@175
PS1, Line 175:     const auto s = detector.Detect(&md);
> It'd be nice to avoid "double detection" (here and in BuiltInNtp when --bui
I changed the default for --builtin_ntp_client_enable_auto_config_in_cloud to 'true', so now it should work as expected.

I don't think --time_source=auto should imply --builtin_ntp_client_enable_auto_config_in_cloud=true: otherwise, there is no way to auto-detect the source and use the custom settings for the --builtin_ntp_servers flag.  Does it make sense?


http://gerrit.cloudera.org:8080/#/c/15161/1/src/kudu/clock/hybrid_clock.cc@180
PS1, Line 180:       time_service_.reset(new clock::BuiltInNtp);
> Instead of actually constructing time_service_, could we use the detection 
Done



-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Fri, 07 Feb 2020 03:17:46 +0000
Gerrit-HasComments: Yes

[kudu-CR] [clock] introduce time source auto selection

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/15161 )

Change subject: [clock] introduce time source auto selection
......................................................................


Patch Set 6:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/15161/6/src/kudu/clock/hybrid_clock-test.cc
File src/kudu/clock/hybrid_clock-test.cc:

http://gerrit.cloudera.org:8080/#/c/15161/6/src/kudu/clock/hybrid_clock-test.cc@382
PS6, Line 382:   clock_.reset(new HybridClock);
> Why not to use std::make_unique() ?
We don't use C++14 features yet, at least to avoid compilation warnings.



-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 6
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>
Gerrit-Comment-Date: Sat, 08 Feb 2020 01:52:54 +0000
Gerrit-HasComments: Yes

[kudu-CR] [clock] introduce time source auto selection

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/15161 )

Change subject: [clock] introduce time source auto selection
......................................................................


Patch Set 9: Code-Review+2

(1 comment)

http://gerrit.cloudera.org:8080/#/c/15161/9/src/kudu/clock/builtin_ntp.h
File src/kudu/clock/builtin_ntp.h:

http://gerrit.cloudera.org:8080/#/c/15161/9/src/kudu/clock/builtin_ntp.h@69
PS9, Line 69:   // Whether the auto-configuration is enabled for the built-in NTP service.
            :   static bool auto_configuration_enabled();
            : 
Should remove this.



-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 9
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Greg Solovyev <gs...@cloudera.com>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>
Gerrit-Comment-Date: Fri, 14 Feb 2020 05:38:26 +0000
Gerrit-HasComments: Yes

[kudu-CR] [clock] introduce time source auto selection

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/15161 )

Change subject: [clock] introduce time source auto selection
......................................................................


Patch Set 8:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/15161/8//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/15161/8//COMMIT_MSG@16
PS8, Line 16:   * AWS and GCE cloud environments: the 'builtin' time source is
> 'builtin' +  'builtin_ntp_client_enable_auto_config' can be replaced with '
Yep, this sounds like a good option if we extend what 'time source' means.  Thank you for the idea!

I think we can use this option if it turns out that we want to keep the ability to use the 'builtin' source with the ability to auto-configure it.



-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 8
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Greg Solovyev <gs...@cloudera.com>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>
Gerrit-Comment-Date: Fri, 14 Feb 2020 00:58:26 +0000
Gerrit-HasComments: Yes

[kudu-CR] [clock] introduce time source auto selection

Posted by "Volodymyr Verovkin (Code Review)" <ge...@cloudera.org>.
Volodymyr Verovkin has posted comments on this change. ( http://gerrit.cloudera.org:8080/15161 )

Change subject: [clock] introduce time source auto selection
......................................................................


Patch Set 6:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/15161/6/src/kudu/clock/hybrid_clock-test.cc
File src/kudu/clock/hybrid_clock-test.cc:

http://gerrit.cloudera.org:8080/#/c/15161/6/src/kudu/clock/hybrid_clock-test.cc@382
PS6, Line 382:   clock_.reset(new HybridClock);
Why not to use std::make_unique() ?


http://gerrit.cloudera.org:8080/#/c/15161/6/src/kudu/clock/hybrid_clock.cc
File src/kudu/clock/hybrid_clock.cc:

http://gerrit.cloudera.org:8080/#/c/15161/6/src/kudu/clock/hybrid_clock.cc@91
PS6, Line 91:               TIME_SOURCE_AUTO ", "
Looks a bit cryptic. I suggest to replace macro with text (here and below).


http://gerrit.cloudera.org:8080/#/c/15161/6/src/kudu/clock/hybrid_clock.cc@466
PS6, Line 466:     case TimeSource::SYSTEM_NTP_SYNC:
Should it be wrapped into #if defined(KUDU_HAS_SYSTEM_TIME_SOURCE) ?



-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 6
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>
Gerrit-Comment-Date: Fri, 07 Feb 2020 20:40:25 +0000
Gerrit-HasComments: Yes

[kudu-CR] [clock] introduce time source auto selection

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/15161 )

Change subject: [clock] introduce time source auto selection
......................................................................


Patch Set 6:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/15161/6/src/kudu/clock/hybrid_clock.cc
File src/kudu/clock/hybrid_clock.cc:

http://gerrit.cloudera.org:8080/#/c/15161/6/src/kudu/clock/hybrid_clock.cc@416
PS6, Line 416:         result_builtin_ntp_servers.emplace_back(ntp_server,
             :                                                 clock::kStandardNtpPort);
> This sounds reasonable.  I'll set the default value for the glfag then.  Th
After taking a closer look, I think passing around the auto-detected servers is safer in this case.

If controlling the set of servers for the built-in NTP client using the flags, it would be necessary to set default values for the following flags:
  * --builtin_ntp_servers
  * --builtin_ntp_client_enable_auto_config_in_cloud

As I understand, the idea is to (a) set the default value for --builtin_ntp_servers using the set of the servers found at the time of auto-selecting the time source, and (b) set the default value for --builtin_ntp_client_enable_auto_config_in_cloud to 'false' to avoid doing the same work twice.  However, if the value for flag in (b) has been explicitly set to 'true', setting the default value for the flag to 'false' wouldn't help to avoid running the auto-detection of the NTP servers again in BuiltInNtp::InitImpl().

I also thought of getting rid of the --builtin_ntp_client_enable_auto_config_in_cloud flag and using the special value (an empty string) for --builtin_ntp_servers.  However, if going that route, it would prevent us from using the custom set of NTP servers to fallback if the auto-configuration fails.

So, I think I'll keep the approach of passing the auto-detected NTP servers around.

What do you think?



-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 6
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>
Gerrit-Comment-Date: Wed, 12 Feb 2020 00:05:30 +0000
Gerrit-HasComments: Yes

[kudu-CR] [clock] auto-selection of time source

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/15161 )

Change subject: [clock] auto-selection of time source
......................................................................


Patch Set 1:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/15161/1/src/kudu/clock/hybrid_clock.cc
File src/kudu/clock/hybrid_clock.cc:

http://gerrit.cloudera.org:8080/#/c/15161/1/src/kudu/clock/hybrid_clock.cc@175
PS1, Line 175:     const auto s = detector.Detect(&md);
It'd be nice to avoid "double detection" (here and in BuiltInNtp when --builtin_ntp_client_enable_auto_config_in_cloud is set) as that'll slow down startup.

On a related note, should --time_source=auto imply --builtin_ntp_client_enable_auto_config_in_cloud? Should we remove --builtin_ntp_client_enable_auto_config_in_cloud altogether and expect that if the time source is auto, the user wants us to set up the built-in NTP server list too?


http://gerrit.cloudera.org:8080/#/c/15161/1/src/kudu/clock/hybrid_clock.cc@180
PS1, Line 180:       time_service_.reset(new clock::BuiltInNtp);
Instead of actually constructing time_service_, could we use the detection results to convert the gflag value of 'auto'  into one of 'builtin', 'system', or 'system_unsync', and then use the existing if/elseif/else to construct the time_service_?



-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 05 Feb 2020 18:55:13 +0000
Gerrit-HasComments: Yes

[kudu-CR] [clock] introduce time source auto selection

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/15161 )

Change subject: [clock] introduce time source auto selection
......................................................................


Patch Set 6:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/15161/6/src/kudu/clock/hybrid_clock.cc
File src/kudu/clock/hybrid_clock.cc:

http://gerrit.cloudera.org:8080/#/c/15161/6/src/kudu/clock/hybrid_clock.cc@416
PS6, Line 416:         result_builtin_ntp_servers.emplace_back(ntp_server,
             :                                                 clock::kStandardNtpPort);
> After taking a closer look, I think passing around the auto-detected server
I don't feel strongly about this. What I do care more about is:
1. That there's just one InstanceDetector. We may add more auto-configuration for cloud providers in the future, and it'll be annoying to consider multiple InstanceDetectors, each in a different module at a different place in the overall server module hierarchy, not to mention guarantee that we only ever run one InstanceDetector in a given server startup.
2. That we minimize the number of control knobs. Meaning, we should consider all the possible use cases, eliminate ones we don't think are important, and end up with a small number of knobs for users to consider.



-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 6
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>
Gerrit-Comment-Date: Wed, 12 Feb 2020 01:19:41 +0000
Gerrit-HasComments: Yes

[kudu-CR] [clock] introduce time source auto selection

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/15161 )

Change subject: [clock] introduce time source auto selection
......................................................................


Patch Set 9:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/15161/9/src/kudu/clock/builtin_ntp.h
File src/kudu/clock/builtin_ntp.h:

http://gerrit.cloudera.org:8080/#/c/15161/9/src/kudu/clock/builtin_ntp.h@69
PS9, Line 69:   // Whether the auto-configuration is enabled for the built-in NTP service.
            :   static bool auto_configuration_enabled();
            : 
> Should remove this.
Good catch!

Done.



-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 9
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Greg Solovyev <gs...@cloudera.com>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>
Gerrit-Comment-Date: Fri, 14 Feb 2020 18:13:49 +0000
Gerrit-HasComments: Yes

[kudu-CR] [clock] introduce time source auto selection

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/15161 )

Change subject: [clock] introduce time source auto selection
......................................................................


Patch Set 10:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/15161/9/src/kudu/clock/builtin_ntp.h
File src/kudu/clock/builtin_ntp.h:

http://gerrit.cloudera.org:8080/#/c/15161/9/src/kudu/clock/builtin_ntp.h@69
PS9, Line 69:   // Whether the auto-configuration is enabled for the built-in NTP service.
            :   static bool auto_configuration_enabled();
            : 
> Still there?
whoops, I'm surprised.  Probably, I was lost in multiple branches I created for this series of patches.



-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 10
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Greg Solovyev <gs...@cloudera.com>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>
Gerrit-Comment-Date: Fri, 14 Feb 2020 20:05:02 +0000
Gerrit-HasComments: Yes

[kudu-CR] [clock] introduce time source auto selection

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/15161 )

Change subject: [clock] introduce time source auto selection
......................................................................


Patch Set 10:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/15161/9/src/kudu/clock/builtin_ntp.h
File src/kudu/clock/builtin_ntp.h:

http://gerrit.cloudera.org:8080/#/c/15161/9/src/kudu/clock/builtin_ntp.h@69
PS9, Line 69:   // Whether the auto-configuration is enabled for the built-in NTP service.
            :   static bool auto_configuration_enabled();
            : 
> Good catch!
Still there?



-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 10
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Greg Solovyev <gs...@cloudera.com>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>
Gerrit-Comment-Date: Fri, 14 Feb 2020 18:45:37 +0000
Gerrit-HasComments: Yes

[kudu-CR] [clock] introduce time source auto selection

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/15161 )

Change subject: [clock] introduce time source auto selection
......................................................................


Patch Set 8:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/15161/8/src/kudu/clock/hybrid_clock.cc
File src/kudu/clock/hybrid_clock.cc:

http://gerrit.cloudera.org:8080/#/c/15161/8/src/kudu/clock/hybrid_clock.cc@433
PS8, Line 433:       if (clock::BuiltInNtp::auto_configuration_enabled()) {
> I think current code guarantees that only one InstanceDetector is used: the
Ah, and the importance of the '--time_source=builtin --builtin_ntp_enable_auto_config=true' case is that it gives you guarantee of using the built-in NTP client, regardless of the environment you run Kudu at.  It either uses the dedicated NTP servers if the environment provides that or uses the specified NTP servers (or the default list).

I thought that would be the way of making the built-in NTP client the default time source with the ability to use the dedicated servers in case of cloud providers.  Or we don't need the assurance of using the built-in NTP client regardless of the environment?



-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 8
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>
Gerrit-Comment-Date: Wed, 12 Feb 2020 07:34:20 +0000
Gerrit-HasComments: Yes

[kudu-CR] [clock] introduce time source auto selection

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/15161 )

Change subject: [clock] introduce time source auto selection
......................................................................


Patch Set 8:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/15161/8/src/kudu/clock/hybrid_clock.cc
File src/kudu/clock/hybrid_clock.cc:

http://gerrit.cloudera.org:8080/#/c/15161/8/src/kudu/clock/hybrid_clock.cc@433
PS8, Line 433:       if (clock::BuiltInNtp::auto_configuration_enabled()) {
> Ah, and the importance of the '--time_source=builtin --builtin_ntp_enable_a
Regarding instances of InstanceDetector: agreed that the current code tries to ensure that only one is ever used. But, if there's a bug, or if it regresses in the future, we'll slow down startup in a way that's not necessary obvious. I'd rather there be just one InstanceDetector instance across the entire server, and that instance "move up" the module tree as needed. Meaning, it can start in HybridClock because that's the only place it's needed now, and if we need it in some other part of the server in the future, it 'll move out of HybridClock and into ServerBase. This is the safest way to guarantee that we'll never ever duplicate instance detection, at a cost of some extra plumbing.

Regarding --time_source=builtin and --builtin_ntp_enable_auto_config=true, agreed that it is a compelling configuration for "use the built-in NTP client no matter what, with the best possible server list for each environment." The thing is, the value of "use the built-in NTP client no matter what" is somewhat eroded after considering Azure, where the "best" choice is the system time source. Is preserving that use case worth the added complexity of the additional --builtin_ntp_enable_auto_config knob, which every AWS/GCE user will want to use? I don't disagree that there's some uncertainty here, but I think we're better off starting with fewer knobs and adding more in response to feedback rather than the other way around.



-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 8
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>
Gerrit-Comment-Date: Wed, 12 Feb 2020 08:22:44 +0000
Gerrit-HasComments: Yes

[kudu-CR] [clock] introduce time source auto selection

Posted by "Volodymyr Verovkin (Code Review)" <ge...@cloudera.org>.
Volodymyr Verovkin has posted comments on this change. ( http://gerrit.cloudera.org:8080/15161 )

Change subject: [clock] introduce time source auto selection
......................................................................


Patch Set 8:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/15161/8//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/15161/8//COMMIT_MSG@16
PS8, Line 16:   * AWS and GCE cloud environments: the 'builtin' time source is
'builtin' +  'builtin_ntp_client_enable_auto_config' can be replaced with 'builtin_with_auto_config' and 'builtin_with_server_list' in order to simplify logic and reduce number of flags.



-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 8
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Greg Solovyev <gs...@cloudera.com>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>
Gerrit-Comment-Date: Wed, 12 Feb 2020 21:09:55 +0000
Gerrit-HasComments: Yes

[kudu-CR] [clock] introduce time source auto selection

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Hello Tidy Bot, Kudu Jenkins, Adar Dembo, Grant Henke, 

I'd like you to reexamine a change. Please visit

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

to look at the new patch set (#4).

Change subject: [clock] introduce time source auto selection
......................................................................

[clock] introduce time source auto selection

This patch introduces a new time source named 'auto'.  When the
--time_source flag is set to 'auto', the system behaves as the
following:

  * If the host is of known cloud instance type that provides
    a dedicated NTP server, the time source is set to 'builtin'.

  * If the host is of known cloud instance type that doesn't provide
    a dedicated NTP server or the host is not recognized as a cloud
    instance, the time source is set to 'system'.

In the former case, since --builtin_ntp_client_enable_auto_config_in_cloud
is set to 'true' by default, the built-in NTP client is configured
to use the dedicated NTP server provided by the cloud platform.  To
disable the auto-configuration of the built-in NTP client and use
custom list of NTP servers specified by the --builtin_ntp_servers flag,
set --builtin_ntp_client_enable_auto_config_in_cloud=false.

Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
---
M src/kudu/client/client_examples-test.sh
M src/kudu/clock/builtin_ntp.cc
M src/kudu/clock/builtin_ntp.h
M src/kudu/clock/hybrid_clock-test.cc
M src/kudu/clock/hybrid_clock.cc
M src/kudu/clock/hybrid_clock.h
M src/kudu/mini-cluster/external_mini_cluster.cc
M src/kudu/util/test_util.cc
8 files changed, 289 insertions(+), 82 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/61/15161/4
-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 4
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)

[kudu-CR] [clock] introduce time source auto selection

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Hello Tidy Bot, Attila Bukor, Kudu Jenkins, Adar Dembo, Grant Henke, Greg Solovyev, Volodymyr Verovkin, Hao Hao, Bankim Bhavsar, 

I'd like you to reexamine a change. Please visit

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

to look at the new patch set (#11).

Change subject: [clock] introduce time source auto selection
......................................................................

[clock] introduce time source auto selection

This patch introduces a new pseudo time source named 'auto'.  When
the --time_source flag is set to 'auto', Kudu masters and tablet
servers automatically select the most appropriate time source for
the hybrid clock (see below for the rationale behind the choice).

Below are the rules for the time source auto-selection:

  * AWS and GCE cloud environments: the 'builtin' time source is
    used (i.e. the hybrid clock uses the built-in NTP client) and
    the built-in NTP client is configured to use the dedicated NTP
    server provided by the environment

  * Azure cloud environments, not-yet-supported cloud environments,
    and non-cloud machines: the 'system' time source is used
    (i.e. the hybrid clock uses NTP-synchronized local clock)

  * macOS machines:
      ** High Sierra 10.13 and newer: 'system'
      ** releases prior to High Sierra: 'system_unsync'

As for the rationale behind auto-selecting this or another time source:

  * when NTP servers are not known beforehand or their high availability
    is not guaranteed, relying on the local NTP-synchronized clock is
    the only rational choice (and it's backward-compatible)

  * when it's guaranteed to have a set of highly available NTP servers,
    using the built-in NTP client is the best choice because it removes
    the requirement to configure and maintain NTP server at the machine

NOTE: this patch essentially removes the functionality introduced in
      69cf2065805163799d85dc38b812eb73388d3a02 (i.e. auto-configuration
      of the built-in NTP client), so now automatic configuration of the
      built-in NTP client is not available outside of the
      --time_source=auto context.

Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
---
M src/kudu/clock/builtin_ntp.cc
M src/kudu/clock/hybrid_clock-test.cc
M src/kudu/clock/hybrid_clock.cc
M src/kudu/clock/hybrid_clock.h
M src/kudu/mini-cluster/external_mini_cluster-test.cc
5 files changed, 271 insertions(+), 126 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/61/15161/11
-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 11
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Greg Solovyev <gs...@cloudera.com>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>

[kudu-CR] [clock] introduce time source auto selection

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has removed a vote on this change.

Change subject: [clock] introduce time source auto selection
......................................................................


Removed Verified-1 by Kudu Jenkins (120)
-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: deleteVote
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 6
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>

[kudu-CR] [clock] introduce time source auto selection

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Hello Tidy Bot, Kudu Jenkins, Adar Dembo, Grant Henke, 

I'd like you to reexamine a change. Please visit

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

to look at the new patch set (#3).

Change subject: [clock] introduce time source auto selection
......................................................................

[clock] introduce time source auto selection

This patch introduces a new time source named 'auto'.  When the
--time_source flag is set to 'auto', the system behaves as the
following:

  * If the host is of known cloud instance type that provides
    a dedicated NTP server, the time source is set to 'builtin'.

  * If the host is of known cloud instance type that doesn't provide
    a dedicated NTP server or the host is not recognized as a cloud
    instance, the time source is set to 'system'.

In the former case, since --builtin_ntp_client_enable_auto_config_in_cloud
is set to 'true' by default, the built-in NTP client is configured
to use the dedicated NTP server provided by the cloud platform.  To
disable the auto-configuration of the built-in NTP client and use
custom list of NTP servers specified by the --builtin_ntp_servers flag,
set --builtin_ntp_client_enable_auto_config_in_cloud=false.

Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
---
M src/kudu/client/client_examples-test.sh
M src/kudu/clock/builtin_ntp.cc
M src/kudu/clock/builtin_ntp.h
M src/kudu/clock/hybrid_clock-test.cc
M src/kudu/clock/hybrid_clock.cc
M src/kudu/clock/hybrid_clock.h
M src/kudu/mini-cluster/external_mini_cluster.cc
M src/kudu/util/test_util.cc
8 files changed, 289 insertions(+), 82 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/61/15161/3
-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 3
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)

[kudu-CR] [clock] introduce time source auto selection

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/15161 )

Change subject: [clock] introduce time source auto selection
......................................................................


Patch Set 6: Verified+1

unrelated test failures:
  * testSplitKeyRange
  * SlowTabletBootstrapTest.TestFallBehindSlowBootstrap


-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 6
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>
Gerrit-Comment-Date: Fri, 07 Feb 2020 06:46:19 +0000
Gerrit-HasComments: No

[kudu-CR] [clock] introduce time source auto selection

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/15161 )

Change subject: [clock] introduce time source auto selection
......................................................................


Patch Set 8:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/15161/8/src/kudu/clock/hybrid_clock.cc
File src/kudu/clock/hybrid_clock.cc:

http://gerrit.cloudera.org:8080/#/c/15161/8/src/kudu/clock/hybrid_clock.cc@433
PS8, Line 433:       if (clock::BuiltInNtp::auto_configuration_enabled()) {
> I still don't see the use case for --time_source=auto with --builtin_ntp_en
I think current code guarantees that only one InstanceDetector is used: the non-default constructor of BuiltinNtp class doesn't activate the InstanceDetector when the set of servers is non-empty, so that question shouldn't bother us too much.

So, the important piece is about the use cases we want to support.

I agree that the case of '--time_source=auto --builtin_ntp_enable_auto_config=false' doesn't seem to be important.  However, there is a use case of '--time_source=builtin --builtin_ntp_enable_auto_config=true', which starts playing once switching the time source to 'builtin'.  Does this use case seem useful?   I think so, but I can be convinced otherwise.  If you agree that the mentioned case is useful then I think we should keep both flags, right?  And if keeping both flags, why to impose some implicit dependency, and, consequently, prohibiting the '--time_source=auto --builtin_ntp_enable_auto_config=false' case?



-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 8
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>
Gerrit-Comment-Date: Wed, 12 Feb 2020 07:14:06 +0000
Gerrit-HasComments: Yes

[kudu-CR] [clock] introduce time source auto selection

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Hello Tidy Bot, Kudu Jenkins, Adar Dembo, Grant Henke, Volodymyr Verovkin, 

I'd like you to reexamine a change. Please visit

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

to look at the new patch set (#8).

Change subject: [clock] introduce time source auto selection
......................................................................

[clock] introduce time source auto selection

This patch introduces a new pseudo time source named 'auto'.  When
the --time_source flag is set to 'auto', Kudu masters and tablet
servers automatically select the most appropriate time source for
the hybrid clock (see below for the rationale behind the choice).

Below are the rules for the time source auto-selection:

  * AWS and GCE cloud environments: the 'builtin' time source is
    used (i.e. the hybrid clock uses the built-in NTP client)
      ** if --builtin_ntp_client_enable_auto_config is set to 'true'
         (the default), the dedicated NTP server provided by the
         environment is used as the reference server for the built-in
         NTP client
      ** if --builtin_ntp_client_enable_auto_config is set to 'false',
         the built-in NTP client is configured with the set of NTP
         servers provided by the --builtin_ntp_servers flag

  * Azure cloud environments, not-yet-supported cloud environments,
    and non-cloud machines: the 'system' time source is used
    (i.e. the hybrid clock uses NTP-synchronized local clock)

  * macOS machines:
      ** High Sierra 10.13 and newer: 'system'
      ** releases prior to High Sierra: 'system_unsync'

As for the rationale behind auto-selecting this or another time source:

  * when NTP servers are not known beforehand or their high availability
    is not guaranteed, relying on the local NTP-synchronized clock is
    the only rational choice (and it's backward-compatible)

  * when it's guaranteed to have a set of highly available NTP servers,
    using the built-in NTP client is the best choice because it removes
    the requirement to configure and maintain NTP server at the machine

Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
---
M src/kudu/clock/builtin_ntp.cc
M src/kudu/clock/builtin_ntp.h
M src/kudu/clock/hybrid_clock-test.cc
M src/kudu/clock/hybrid_clock.cc
M src/kudu/clock/hybrid_clock.h
5 files changed, 252 insertions(+), 83 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/61/15161/8
-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 8
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>

[kudu-CR] [clock] introduce time source auto selection

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Hello Tidy Bot, Kudu Jenkins, Adar Dembo, Grant Henke, Volodymyr Verovkin, 

I'd like you to reexamine a change. Please visit

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

to look at the new patch set (#7).

Change subject: [clock] introduce time source auto selection
......................................................................

[clock] introduce time source auto selection

This patch introduces a new pseudo time source named 'auto'.  When
the --time_source flag is set to 'auto', Kudu masters and tablet
servers automatically select the most appropriate time source for
the hybrid clock (see below for the rationale behind the choice).

  * for AWS and GCE cloud environments, the 'builtin' time source is
    auto-selected (i.e. the hybrid clock uses the built-in NTP client)
    ** if --builtin_ntp_client_enable_auto_config flag is set to 'true'
       (that's the default), the dedicated NTP server provided by the
       environment is used as the reference server for the built-in
       NTP client (see AWS/GCE documentation on configuring NTP
       for more details)
    ** if --builtin_ntp_client_enable_auto_config flag is set to
       'false', the built-in NTP client is configured to use the set
       of NTP servers provided by the --builtin_ntp_servers flag

  * for Azure cloud environments, not-yet-supported cloud environments,
    and non-cloud VMs/machines, the 'system' time source
    is auto-selected (i.e. the hybrid uses NTP-synchronized local clock)

  * macOS VMs/machines:
    ** for High Sierra 10.13 and newer the 'system' time source
       is auto-selected
    ** for releases prior to High Sierra, the 'system_unsync' time
       source is auto-selected

As for the rationale behind auto-selecting this or another time source:

  * when it's guaranteed to have known set of highly available NTP
    servers, using the built-in NTP client in Kudu is the best choice
    because it allows to spend zero effort on providing Kudu with
    NTP-synchronized time source

  * when NTP servers are not known beforehand or their high availability
    is not guaranteed, relying on the local NTP-synchronized clock seems
    to be the only rational choice, and it's also backward-compatible

Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
---
M src/kudu/clock/builtin_ntp.cc
M src/kudu/clock/builtin_ntp.h
M src/kudu/clock/hybrid_clock-test.cc
M src/kudu/clock/hybrid_clock.cc
M src/kudu/clock/hybrid_clock.h
5 files changed, 252 insertions(+), 83 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/61/15161/7
-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 7
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>

[kudu-CR] [clock] introduce time source auto selection

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Hello Tidy Bot, Attila Bukor, Kudu Jenkins, Adar Dembo, Grant Henke, Greg Solovyev, Volodymyr Verovkin, Hao Hao, Bankim Bhavsar, 

I'd like you to reexamine a change. Please visit

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

to look at the new patch set (#9).

Change subject: [clock] introduce time source auto selection
......................................................................

[clock] introduce time source auto selection

This patch introduces a new pseudo time source named 'auto'.  When
the --time_source flag is set to 'auto', Kudu masters and tablet
servers automatically select the most appropriate time source for
the hybrid clock (see below for the rationale behind the choice).

Below are the rules for the time source auto-selection:

  * AWS and GCE cloud environments: the 'builtin' time source is
    used (i.e. the hybrid clock uses the built-in NTP client) and
    the built-in NTP client is configured to use the dedicated NTP
    server provided by the environment

  * Azure cloud environments, not-yet-supported cloud environments,
    and non-cloud machines: the 'system' time source is used
    (i.e. the hybrid clock uses NTP-synchronized local clock)

  * macOS machines:
      ** High Sierra 10.13 and newer: 'system'
      ** releases prior to High Sierra: 'system_unsync'

As for the rationale behind auto-selecting this or another time source:

  * when NTP servers are not known beforehand or their high availability
    is not guaranteed, relying on the local NTP-synchronized clock is
    the only rational choice (and it's backward-compatible)

  * when it's guaranteed to have a set of highly available NTP servers,
    using the built-in NTP client is the best choice because it removes
    the requirement to configure and maintain NTP server at the machine

NOTE: this patch essentially removes the functionality introduced in
      69cf2065805163799d85dc38b812eb73388d3a02 (i.e. auto-configuration
      of the built-in NTP client), so now automatic configuration of the
      built-in NTP client is not available outside of the
      --time_source=auto context.

Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
---
M src/kudu/clock/builtin_ntp.cc
M src/kudu/clock/builtin_ntp.h
M src/kudu/clock/hybrid_clock-test.cc
M src/kudu/clock/hybrid_clock.cc
M src/kudu/clock/hybrid_clock.h
M src/kudu/mini-cluster/external_mini_cluster-test.cc
6 files changed, 270 insertions(+), 122 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/61/15161/9
-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 9
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Greg Solovyev <gs...@cloudera.com>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>

[kudu-CR] [clock] introduce time source auto selection

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Hello Tidy Bot, Kudu Jenkins, Adar Dembo, Grant Henke, Volodymyr Verovkin, 

I'd like you to reexamine a change. Please visit

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

to look at the new patch set (#6).

Change subject: [clock] introduce time source auto selection
......................................................................

[clock] introduce time source auto selection

This patch introduces a new time source named 'auto'.  When the
--time_source flag is set to 'auto', the system behaves as the
following:

  * If the host is of known cloud instance type that provides
    a dedicated NTP server, the time source is set to 'builtin'.

  * If the host is of known cloud instance type that doesn't provide
    a dedicated NTP server or the host is not recognized as a cloud
    instance, the time source is set to 'system'.

In the former case, since --builtin_ntp_client_enable_auto_config_in_cloud
is set to 'true' by default, the built-in NTP client is configured
to use the dedicated NTP server provided by the cloud platform.  To
disable the auto-configuration of the built-in NTP client and use
custom list of NTP servers specified by the --builtin_ntp_servers flag,
set --builtin_ntp_client_enable_auto_config_in_cloud=false.

Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
---
M src/kudu/client/client_examples-test.sh
M src/kudu/clock/builtin_ntp.cc
M src/kudu/clock/builtin_ntp.h
M src/kudu/clock/hybrid_clock-test.cc
M src/kudu/clock/hybrid_clock.cc
M src/kudu/clock/hybrid_clock.h
M src/kudu/mini-cluster/external_mini_cluster.cc
M src/kudu/util/test_util.cc
8 files changed, 291 insertions(+), 82 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/61/15161/6
-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 6
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>

[kudu-CR] [clock] introduce time source auto selection

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/15161 )

Change subject: [clock] introduce time source auto selection
......................................................................

[clock] introduce time source auto selection

This patch introduces a new pseudo time source named 'auto'.  When
the --time_source flag is set to 'auto', Kudu masters and tablet
servers automatically select the most appropriate time source for
the hybrid clock (see below for the rationale behind the choice).

Below are the rules for the time source auto-selection:

  * AWS and GCE cloud environments: the 'builtin' time source is
    used (i.e. the hybrid clock uses the built-in NTP client) and
    the built-in NTP client is configured to use the dedicated NTP
    server provided by the environment

  * Azure cloud environments, not-yet-supported cloud environments,
    and non-cloud machines: the 'system' time source is used
    (i.e. the hybrid clock uses NTP-synchronized local clock)

  * macOS machines:
      ** High Sierra 10.13 and newer: 'system'
      ** releases prior to High Sierra: 'system_unsync'

As for the rationale behind auto-selecting this or another time source:

  * when NTP servers are not known beforehand or their high availability
    is not guaranteed, relying on the local NTP-synchronized clock is
    the only rational choice (and it's backward-compatible)

  * when it's guaranteed to have a set of highly available NTP servers,
    using the built-in NTP client is the best choice because it removes
    the requirement to configure and maintain NTP server at the machine

NOTE: this patch essentially removes the functionality introduced in
      69cf2065805163799d85dc38b812eb73388d3a02 (i.e. auto-configuration
      of the built-in NTP client), so now automatic configuration of the
      built-in NTP client is not available outside of the
      --time_source=auto context.

Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Reviewed-on: http://gerrit.cloudera.org:8080/15161
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <ad...@cloudera.com>
---
M src/kudu/clock/builtin_ntp.cc
M src/kudu/clock/hybrid_clock-test.cc
M src/kudu/clock/hybrid_clock.cc
M src/kudu/clock/hybrid_clock.h
M src/kudu/mini-cluster/external_mini_cluster-test.cc
5 files changed, 271 insertions(+), 126 deletions(-)

Approvals:
  Kudu Jenkins: Verified
  Adar Dembo: Looks good to me, approved

-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 12
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Greg Solovyev <gs...@cloudera.com>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>

[kudu-CR] [clock] auto-selection of time source

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, Adar Dembo, Grant Henke, 

I'd like you to reexamine a change. Please visit

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

to look at the new patch set (#2).

Change subject: [clock] auto-selection of time source
......................................................................

[clock] auto-selection of time source

This patch introduces a new time source named 'auto'.  When
--time_source flag is set to 'auto', the system's behaves is the
following:

  * If the host is of known cloud instance type that provides
    a dedicated NTP server, the time source is set to 'builtin'.

  * If the host is of known cloud instance type that doesn't provide
    a dedicated NTP server or the host is not recognized as a cloud
    instance, the time source is set to 'system'
    (if 'system' time source is supported, otherwise set to
     'system_unsync').

In former case, if the --builtin_ntp_client_enable_auto_config_in_cloud
flag is set to 'true', the built-in NTP client is configured to use
the dedicated NTP server provided by the cloud platform.

Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
---
M src/kudu/clock/builtin_ntp.cc
M src/kudu/clock/builtin_ntp.h
M src/kudu/clock/hybrid_clock-test.cc
M src/kudu/clock/hybrid_clock.cc
M src/kudu/clock/hybrid_clock.h
M src/kudu/util/test_util.cc
6 files changed, 278 insertions(+), 82 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/61/15161/2
-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [clock] introduce time source auto selection

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/15161 )

Change subject: [clock] introduce time source auto selection
......................................................................


Patch Set 11: Code-Review+2


-- 
To view, visit http://gerrit.cloudera.org:8080/15161
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If9f2bc94f4a1ad32fe365d4f6f0707913fb476a4
Gerrit-Change-Number: 15161
Gerrit-PatchSet: 11
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Greg Solovyev <gs...@cloudera.com>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Volodymyr Verovkin <ve...@cloudera.com>
Gerrit-Comment-Date: Fri, 14 Feb 2020 21:22:52 +0000
Gerrit-HasComments: No