Skip to content

Use NTP admin API instead of sled agent, remove sled agent time_sync API - #8597

Merged
smklein merged 1 commit into
mainfrom
ntp-admin-use
Jul 18, 2025
Merged

smklein merged 1 commit into
mainfrom
ntp-admin-use

Conversation

@smklein

@smklein smklein commented Jul 15, 2025 •

Copy link
Copy Markdown
Collaborator

Builds on #8555

This PR:

  • Avoids the sled agent "zlogin to NTP zone" calls to chronyc, instead relying on the NTP admin server
  • Removes the "timesync_get" API exposed from the sled agent, and moves all callers (RSS only) to call the NTP admin server instead

Fixes #8590

@smklein
smklein force-pushed the ntp-admin-use branch 2 times, most recently from c4faf10 to 8f65850 Compare July 15, 2025 17:51
@smklein
smklein marked this pull request as ready for review July 15, 2025 19:53
@smklein
smklein requested review from jgallagher and karencfv July 15, 2025 21:54
@smklein

smklein commented Jul 15, 2025

Copy link
Copy Markdown
Collaborator Author

FYI, I ran this on a4x2 - it didn't work, until I fixed an SMF typo, now it works. This is tested implicitly by the "helios / deploy" job, which relies on RSS, and also relies on the timesync API in the NTP admin server.

@karencfv karencfv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

Comment thread openapi/sled-agent.json
}
}
},
"/timesync": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if there's any documentation that relies on checking the response from this endpoint in the logs to debug an NTP sync issue or something similar. I have a vague memory of something like that. If anyone remembers, that documentation should be updated. Perhaps an announcement on Matrix might be good as well? I've certainly used it before if an omicron deployment was taking too long to start.

@jgallagher jgallagher left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

FYI, I ran this on a4x2 - it didn't work, until I fixed an SMF typo, now it works. This is tested implicitly by the "helios / deploy" job, which relies on RSS, and also relies on the timesync API in the NTP admin server.

I don't see an SMF change in this PR - was it something a4x2-specific outside omicron?

Comment thread sled-agent/src/rack_setup/service.rs Resolved
Comment thread sled-agent/src/rack_setup/service.rs Resolved
Comment thread sled-agent/src/rack_setup/service.rs Outdated
async fn wait_for_timesync(
&self,
sled_addresses: &Vec<SocketAddrV6>,
ntp_admin_addresses: &Vec<SocketAddrV6>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize this is consistent with what was already here, but: by accepting a list of socket addrs, we end up rebuilding an NtpAdminClient for every sled inside every attempt of the retry_notify loop. Maybe we should take a &[NtpAdminClient] instead of a list of socket addrs, so we only create the clients once? (I have a vague memory of reqwest clients being relatively expensive to construct, but maybe we solved that some other way?)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, refactored to only create the clients once


let stdout = running_ntp_zone
.run_cmd(&["/usr/bin/chronyc", "-c", "tracking"])
.map_err(TimeSyncError::ExecuteChronyc)?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Love getting rid of this.

@smklein

smklein commented Jul 16, 2025

Copy link
Copy Markdown
Collaborator Author

LGTM, thanks!

FYI, I ran this on a4x2 - it didn't work, until I fixed an SMF typo, now it works. This is tested implicitly by the "helios / deploy" job, which relies on RSS, and also relies on the timesync API in the NTP admin server.

I don't see an SMF change in this PR - was it something a4x2-specific outside omicron?

I pulled the SMF change into #8555

(<dependency name='oxide/ntp' causes the manifest importer to reject the whole service because in that context, it decides / is a character it doesn't like. I had to use <dependency name='ntp' to make it happy)

Base automatically changed from ntp-admin to main July 16, 2025 17:50
@smklein
smklein force-pushed the ntp-admin-use branch 2 times, most recently from 4f6de4b to 6b3f414 Compare July 17, 2025 23:02
@smklein
smklein merged commit 356e0b3 into main Jul 18, 2025
@smklein
smklein deleted the ntp-admin-use branch July 18, 2025 15:47
smklein added a commit that referenced this pull request Jul 22, 2025
Depends on #8597

Queries the NTP admin server for both internal and boundary NTP zones.
Stores a simplified
representation of "who was queried, and is time synced for this
service".

This information will be used in
#8616

Fixes #8546
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make Sled Agent rely on NTTP HTTP API, once it exists

3 participants