-
Notifications
You must be signed in to change notification settings - Fork 58
external_endpoints should support more than 200 silos and TLS certificates #7291
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This all looks correct to me, but out of curiosity: why in the other two queries do we have an explicit
PaginatedBy::Id(pageparams)
, and for this one we seem to be implicitly paginating by zone name? Is the use ofz.zone_name
here relying on implementation details ofdns_zones_list()
?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.
If I recall correctly: the sort of low-level parameter for pagination is
DataPageParams
, which can be parametrized by basically any marker type:omicron/common/src/api/external/mod.rs
Lines 95 to 120 in 460f038
For collections that only support pagination by one thing, like
dns_zones_list()
, their datastore functions just acceptDataPageParams
:omicron/nexus/db-queries/src/db/datastore/dns.rs
Line 52 in 460f038
For relatively few collections we support paginating by any one of a few different fields (well, it's always "id" or "name"). The caller gets to pick. The code is basically the same and these functions accept a
PaginatedBy
, which is just an enum with variants for by-id or by-name, and each variant just contains the appropriateDataPageParams
type:omicron/common/src/api/external/http_pagination.rs
Lines 364 to 368 in 460f038
So I don't think this is relying on an implementation detail. It's just that
dns_zones_list()
only supports paginating by the zone name so it acceptsDataPageParams
directly, while the other functions support pagination by either and so need the wrapper that lets you pick which one you want (but ultimately you're still providing aDataPageParams
and that's what the code is using).There's a bit of an implicit detail here which is that the caller of a paginated function needs to know which field of the object is the marker. (In practice this is not super easy to get wrong because the marker type is usually kind of unique -- a uuid or a Name -- though you could pick a different field that's also a uuid or something.) This applies to all three queries though and every other use of
Paginator
, too (it's encoded in the closure provided tofound_batch()
).