Skip to content

crl-storer: use IfMatch to do a compare-and-swap when uploading#8791

Merged
aarongable merged 2 commits into
mainfrom
crl-storer-compare-and-swap
Jun 12, 2026
Merged

crl-storer: use IfMatch to do a compare-and-swap when uploading#8791
aarongable merged 2 commits into
mainfrom
crl-storer-compare-and-swap

Conversation

@aarongable

@aarongable aarongable commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

The "IfMatch" field of the PutObjectRequest causes the S3 server to return 412 Precondition Failed if the existing object at this path does not have the matching ETag. ETags are opaque unique values that change with each version of the file, so this acts as a compare-and-swap, to ensure that this upload is not racing against another simultaneous upload.

High-level S3 docs: https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-requests.html
If-Match header standard: https://datatracker.ietf.org/doc/html/rfc7232

@aarongable aarongable marked this pull request as ready for review June 9, 2026 18:10
@aarongable aarongable requested a review from a team as a code owner June 9, 2026 18:10
Comment thread crl/storer/storer.go Outdated
Comment thread crl/storer/storer.go Outdated
@aarongable aarongable requested review from a team and beautifulentropy June 11, 2026 20:55
@aarongable aarongable merged commit d8ea179 into main Jun 12, 2026
18 checks passed
@aarongable aarongable deleted the crl-storer-compare-and-swap branch June 12, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants