Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respond with 409 when creating duplicate asset blobs #2011

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

danlamanna
Copy link
Contributor

@danlamanna danlamanna commented Aug 20, 2024

Fixes #1920

The existing upload pathway has a race condition where a competing asset blob gets created after our check. The select_for_update doesn't lock anything if it can't find any existing rows. Using get_or_create should handle this edge case. Even though we still need to handle these conditions, I'm curious why clients are concurrently uploading identical blobs 🤷‍♂️.

I haven't tested this locally yet, but it's probably worth a sanity check already.

@danlamanna danlamanna marked this pull request as ready for review August 21, 2024 11:43
Copy link
Member

@jjnesbitt jjnesbitt left a comment

Choose a reason for hiding this comment

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

Once the linting errors are fixed I think this is good to go.

@yarikoptic
Copy link
Member

dandi-cli downstream tests pass, but I wonder if we necessarily test such invocation. @jwodder WDYT - would there be effect on the client ?

@jwodder
Copy link
Member

jwodder commented Aug 22, 2024

@yarikoptic I don't think this is relevant to any CLI tests.

@danlamanna
Copy link
Contributor Author

@yarikoptic All set?

@yarikoptic
Copy link
Member

I guess - testing in the wilderness would show ;-)

@danlamanna danlamanna added patch Increment the patch version when merged release Create a release when this pr is merged labels Aug 27, 2024
@danlamanna danlamanna merged commit a9fae9d into master Aug 27, 2024
11 checks passed
@danlamanna danlamanna deleted the 1920-ignore-integrity-errors branch August 27, 2024 00:56
@dandibot
Copy link
Member

🚀 PR was released in v0.3.95 🚀

@dandibot dandibot added the released This issue/pull request has been released. label Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged release Create a release when this pr is merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Another possible scenario for IntegrityError unique-etag-size
6 participants