-
Notifications
You must be signed in to change notification settings - Fork 294
[doc] Add host-ntp-time feature doc #6745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/config-ntp-timezone-maxcstate
Are you sure you want to change the base?
[doc] Add host-ntp-time feature doc #6745
Conversation
psafont
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the API surface could be minimized further to avoid footguns. We need to be careful as well with the expectations of setting time pool-wide, this can't be simply implemented naively as it can be very problematic.
I would also ask you to consider dropping the mode that NTP is not used at all: this means that server time in a pool can drift considerably. I would recommend instead a mode where the server run NTP servers and synchronize between themselves. This means that they might not be accurate, but at least they will be synchronized.
The call to set time and get time need changes as well, depending on the previous decision, it might make more sense to use pool-wide calls for these.
doc/content/design/host-ntp-time.md
Outdated
| `host.ntp_mode`, enum host_ntp_mode(ntp_mode_dhcp, ntp_mode_custom, ntp_mode_default) | ||
| `host.ntp_custom_servers`, string set | ||
| `host.ntp_enabled`, bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think merging ntp_enabled and ntp_mode would simplify the control of the feature:
let ntp_mode = DHCP | Manual | Factory | DisabledTo enable ntp mode, users can call set_ntp_mode DHCP; set_ntp_mode Factory; or set_ntp_servers [ntp1.server.com; ntp2.server.com]. And to disable call set_ntp_mode Disabled
And to check whether NTP is enabled, and which mode it is, just call get_ntp_mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be Manual of string list, but we can't express that in the IDL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These mode and enabled fields were also implemented and reviewed as part of the earlier PR #6689 already. This design doc has them for completeness, but it a bit late to change now...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why can't they be changed, they haven't merged to master yet, nor released :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need some more rework both for dev and QA. But it is good that this topic is not related with the feature scope. I changed the doc to meet it.
@psafont In your example, set_ntp_servers is misleading that user may think it represents the real NTP servers no matter in any NTP mode. In fact, it just applies to ntp mode Manual. As Edwin said, the best choice is Manual of string list, but we can't use like that now. So I change host.ntp_custom_servers to host.ntp_manual_servers(not host.ntp_servers in your example) to show they are in direct relations. Is this your last against point in the PR? Hope to have your response soon.
And @robhoes please let me know if you have opinions on this change. Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@changlei-li I'm not sure I follow that... If the mode is called custom then that would match a field called custom_servers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...and I think the term "custom" suits better than "manual", so IMO we don't need any changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea was that calling set_ntp_servers changed the mode to manual to enforce the servers being passed by this call, we can change the name if you think it's more clear
6c68616 to
2bf0903
Compare
pool-level set APIs don't contain time setting. Sorry I didn't show it explicitly in chapter
"Dropping the mode that NTP is not used at all" You mean not to provide a disable-ntp command but a internal ntp server in the pool. That's a big change.
Your suggestion makes sense. By the internal NTP sever, we can set the server time, then the pool time will be synced. It's good to add mode like ntp_mode_internal in the future. |
yes, it's a big change, but it's important to keep it in mind if customers start seeing strange issues when using the manual mode, we might have to provide it as a more robust solution, and deprecate manual mode in the future.
Well, if there's an internal NTP server, the API |
Do you mean the disable NTP? I don't see issues on the manual/custom mode.
Maybe not. They are not on the plan. @psafont Let me summary the key points
Please confirm the two points. They are mostly the requirement level which we have reviewed internally. I don't think we need to have changes if no defects in the current scope. If there are defects, of course I'm glad to accept and fix. |
|
|
I think we need to see these new calls in the right context, which is to provide a way to use the API (and external clients such as XC and XO) to configure NTP, where users currently need to log in to the host and either use xsconsole or use shell commands. Looking at the NTP options in xsconsole is useful to guide us what we'd need in the API. And I think that is what the current API design was inspired by: xsconsole has options to configure NTP servers through DHCP, set them manually, or accept default servers. It also has an option to disable NTP and set time manually. All of this is at the host level. I do agree that turning off NTP is generally not desirable. But people may have hosts currently set up like this already, which we'd want to support. I think it makes sense to have feature parity with xsconsole in the API, so that all current use cases are met. Also xsconsole can then use the API itself. Other interesting improvements have been discussed to avoid hosts in a pool getting out of sync, but those will need to be designed and planned separately. |
2bf0903 to
d98a362
Compare
|
Hi @psafont I have updated the doc. Please review again.
|
d98a362 to
a15b50e
Compare
psafont
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for accepting the changes on set time and the minimization of the API. I think there's one last change that needs to be done before I'm happy. It might seem trivial, but the format accepted is quite important, it reduces the complexity of implementation
Signed-off-by: Changlei Li <changlei.li@cloud.com>
a15b50e to
4d9bf6c
Compare
No description provided.