perf: batch volume existence checks in delete-snapshots#35
Merged
dannysteenman merged 2 commits intomainfrom Feb 23, 2026
Merged
perf: batch volume existence checks in delete-snapshots#35dannysteenman merged 2 commits intomainfrom
dannysteenman merged 2 commits intomainfrom
Conversation
Replace N+1 DescribeVolumes API calls (one per orphaned snapshot) with a single batch lookup that checks all referenced volume IDs at once. When a batch call fails due to a missing volume in the set, the function falls back to individual lookups only for that batch, preserving correctness while still being far more efficient in the common case. Co-Authored-By: unknown <>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
dannysteenman
added a commit
that referenced
this pull request
Mar 19, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
perf: batch volume existence checks in delete-snapshots
Summary
Replaces the N+1
DescribeVolumesAPI call pattern inrunDeleteSnapshotswith a batch lookup. Previously, each orphaned snapshot triggered an individualDescribeVolumescall to check if its source volume still exists. Now, all candidate volume IDs are collected upfront and checked in a single batch call (up to 200 IDs per request).When a batch call fails with
InvalidVolume.NotFound(meaning at least one volume in the batch is gone), the function falls back to individual lookups for that batch only.The old
volumeExistsfunction is replaced bylistExistingVolumeIDs.Review & Testing Checklist for Human
DescribeVolumesAPI limit forVolumeIds. The AWS docs should be checked as the source of truth.Notes