Skip to content

Select snapshots using RepositoryData#snapshotsDetails where possible #95345

@DaveCTurner

Description

@DaveCTurner

The get-snapshots API accepts a size parameter to limit the number of snapshots returned, but today it still retrieves all potentially-matching SnapshotInfo blobs before applying the limit. In repositories containing hundreds/thousands of snapshots this can take many minutes, and consume a large amount of heap. However we have enough information in the RepositoryData to apply the limit before retrieving any SnapshotInfo blobs if sorting by name, start time, or duration. We should do that to save time and memory.


Workaround

Note that the from_sort_value parameter does restrict the SnapshotInfo blobs retrieved if sorting by name, start time, or duration, so you can say sort=start_time&order=asc&from_sort_value=XXXXXX to restrict things to just the snapshots which started after time XXXXXX (in milliseconds since the Unix epoch). If you pick a time close enough to the present then the API still works.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions