Skip to content

ec2: a pending snapshot in a block device mapping is accepted by RegisterImage and by a launch #732

Closed

Description

@scttfrdmn

Found in the live SDK runs for milestone 92 (v0.107.0). #715 made a snapshot's state seedable,
so a snapshot can now sit in pending. #711 made RegisterImage validate each mapping's
snapshot with ec2CheckMappingSnapshot. Neither path checks the snapshot's state: a seeded
pending snapshot is accepted by RegisterImage and by a launch's block-device mapping exactly
as a completed one is.

AWS documents no error for this on RegisterImage specifically, but the generic client-error
table publishes IncorrectState for an operation whose resource is not in the state it needs,
and the practical rule is that a volume cannot be created from a snapshot that has not finished.
#715 already records substrate's reading for DeleteSnapshot/CreateVolume against a
non-completed snapshot; this issue is the same question for the two mapping paths, which that
PR deliberately left alone.

The value is not the refusal itself but what it makes testable: a consumer whose IaC registers an
AMI from a snapshot it just created has a real race, and today no seed can reproduce it.

Acceptance criteria

  • Decide, against AWS's client-error table, whether a pending snapshot in a mapping is
    IncorrectState or accepted — and record the reading in the code as substrate's, since
    AWS does not document it.
  • Apply the decision in ec2CheckMappingSnapshot, so RegisterImage and the launch path
    inherit it from one place.
  • A test seeding pending via POST /v1/ec2/snapshot-status and asserting the chosen
    behaviour on both paths.
  • The ## Provenance note in the release notes, since the code (if any) is substrate's.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions