-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Snapshot + Restore] Set snapshots response size limit #103331
[Snapshot + Restore] Set snapshots response size limit #103331
Conversation
Pinging @elastic/kibana-stack-management (Team:Stack Management) |
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.
Added some suggested revisions to the message text. Let me know if you want to discuss further!
...ck/plugins/snapshot_restore/public/application/sections/home/snapshot_list/snapshot_list.tsx
Outdated
Show resolved
Hide resolved
...ck/plugins/snapshot_restore/public/application/sections/home/snapshot_list/snapshot_list.tsx
Outdated
Show resolved
Hide resolved
…me/snapshot_list/snapshot_list.tsx Co-authored-by: Adam Locke <adam.locke@elastic.co>
…me/snapshot_list/snapshot_list.tsx Co-authored-by: Adam Locke <adam.locke@elastic.co>
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 doing this @alisonelizabeth! Tested locally, code LGTM.
@@ -65,3 +65,9 @@ export const TIME_UNITS: { [key: string]: 'd' | 'h' | 'm' | 's' } = { | |||
MINUTE: 'm', | |||
SECOND: 's', | |||
}; | |||
|
|||
/** | |||
* [Temporary workaround] In order to prevent an unusable UI for users with a large number of snapshots, |
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.
Can we clarify what makes it unusable? For example, is it a client-side performance issue?
@@ -116,7 +116,7 @@ export function registerRepositoriesRoutes({ | |||
snapshot: '_all', | |||
}); | |||
|
|||
const { responses: snapshotResponses } = response.body; | |||
const { snapshots: snapshotList } = response.body; |
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.
As part of the ES changes, the snapshots API should now be compatible again on 8.0 and 7.x
Note for myself and anyone else who is curious. This looks like a breaking change but it's really bringing master into alignment with 7.x (https://github.com/elastic/kibana/blob/7.x/x-pack/plugins/snapshot_restore/server/routes/api/repositories.ts#L115)
> | ||
<FormattedMessage | ||
id="xpack.snapshotRestore.snapshotsList.maxSnapshotsDisplayedDescription" | ||
defaultMessage="You've reached the maximum number of snapshots. To view all of your snapshots, use {docLink}." |
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.
@lockewritesdocs Does "You've reached the maximum number of snapshots" sound like you've hit a technical limit, and you can't have more snapshots beyond this point? I think something like "You've reached the maximum number of snapshots that can be displayed" will remove this ambiguity. WDYT?
Also, do you think it'd be helpful to mention what that limit is, somehow?
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.
We could say something like, "You've reached the maximum number of viewable snapshots."
I'm debating whether the limit is useful. If it's 500 or it's 1,000, does it matter if I can't see them? I'm not entirely sure.
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've changed this to: "You've reached the maximum number of viewable snapshots." I'm not sure if the limit is useful either. I think it's also somewhat obvious based on the pagination.
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.
++ @alisonelizabeth -- I think this is a great compromise.
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.
Didn't re-test locally but I re-reviewed the code and it's great to see we're retaining the "partial response" UX even if some of the snapshots have errors. Thanks for digging into this!
💚 Build SucceededMetrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
#103693) * [Snapshot + Restore] Set snapshots response size limit (#103331) # Conflicts: # x-pack/plugins/snapshot_restore/server/routes/api/repositories.test.ts # x-pack/plugins/snapshot_restore/server/routes/api/repositories.ts # x-pack/plugins/snapshot_restore/server/routes/api/snapshots.test.ts # x-pack/plugins/snapshot_restore/server/routes/api/snapshots.ts * fix merge conflict * skip test Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This PR sets a limit (
1000
) on the number of snapshots displayed in the snapshots table in Snapshot + Restore and displays a warning if that limit is reached. This is a temporary solution to support scenarios where a user has a large number of snapshots that could potentially create performance issues on the client. In the near future, this will be replaced in favor of server-side pagination.This PR is supported on the ES side by: elastic/elasticsearch#74451, elastic/elasticsearch#73952.
Also fixes #44817
How to test
yarn es source -E path.repo=/tmp/es_backups
.max_number_of_snapshots
setting (default is500
). This setting isn't available in the UI, so it's easiest to set up via Console:Note on ES API changes
As part of this work, I've replaced the batched snapshot requests in favor of fetching all snapshots in a single request. The ES snapshots API should also now be compatible again on 8.0 and 7.x, and we will no longer need to maintain two different codebases 🎉 (original PR where divergence was introduced: #39533).
Screenshots