Skip to content

Compute maps up front in SnapshotRetentionTask#100070

Merged
DaveCTurner merged 3 commits intoelastic:mainfrom
DaveCTurner:2023/09/29/SnapshotRetentionTask-snapshot-maps-up-front
Sep 29, 2023
Merged

Compute maps up front in SnapshotRetentionTask#100070
DaveCTurner merged 3 commits intoelastic:mainfrom
DaveCTurner:2023/09/29/SnapshotRetentionTask-snapshot-maps-up-front

Conversation

@DaveCTurner
Copy link
Copy Markdown
Member

Rather than computing a map of all relevant snapshots (per repo and
policy) repeatedly, once for every snapshot, let's compute them all up
front.

Rather than computing a map of all relevant snapshots (per repo and
policy) repeatedly, once for every snapshot, let's compute them all up
front.
@DaveCTurner DaveCTurner added >non-issue :Data Management/ILM+SLM DO NOT USE. Use ":StorageEngine/ILM" or ":Distributed Coordination/SLM" instead. v8.11.0 labels Sep 29, 2023
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@DaveCTurner
Copy link
Copy Markdown
Member Author

@elasticmachine please run elasticsearch-ci/part-2

static boolean snapshotEligibleForDeletion(
SnapshotInfo snapshot,
Map<String, List<SnapshotInfo>> allSnapshots,
Map<String, Map<String, Map<SnapshotId, RepositoryData.SnapshotDetails>>> allSnapshotDetails,
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.

You're straining the very definition of data structures here, David. 😆

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

If this was Haskell they'd be type synonyms.

Copy link
Copy Markdown
Contributor

@joegallo joegallo left a comment

Choose a reason for hiding this comment

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

+1, I'm a bit +-0 on the (internal only) mutability of the map of maps of maps, but I'm willing to go along for the ride on this and some follow up PRs and revisit this when the dust settles.

@DaveCTurner DaveCTurner merged commit 675c2c8 into elastic:main Sep 29, 2023
@DaveCTurner DaveCTurner deleted the 2023/09/29/SnapshotRetentionTask-snapshot-maps-up-front branch September 29, 2023 17:25
piergm pushed a commit to piergm/elasticsearch that referenced this pull request Oct 2, 2023
Rather than computing a map of all relevant snapshots (per repo and
policy) repeatedly, once for every snapshot, let's compute them all up
front.
jakelandis pushed a commit to jakelandis/elasticsearch that referenced this pull request Oct 2, 2023
Rather than computing a map of all relevant snapshots (per repo and
policy) repeatedly, once for every snapshot, let's compute them all up
front.
@DaveCTurner DaveCTurner restored the 2023/09/29/SnapshotRetentionTask-snapshot-maps-up-front branch June 17, 2024 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Data Management/ILM+SLM DO NOT USE. Use ":StorageEngine/ILM" or ":Distributed Coordination/SLM" instead. >non-issue Team:Data Management (obsolete) DO NOT USE. This team no longer exists. v8.11.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants