Skip to content

Rework "Zarr multipart flag rework" - #2887

Open
jjnesbitt wants to merge 4 commits into
zarr-multipart-flagfrom
zarr-multipart-flag-rework
Open

Rework "Zarr multipart flag rework"#2887
jjnesbitt wants to merge 4 commits into
zarr-multipart-flagfrom
zarr-multipart-flag-rework

Conversation

@jjnesbitt

Copy link
Copy Markdown
Member

This PR reworks #2869 to split up the zarr upload endpoints and models from that of asset blobs. This results in a much cleaner API design that is still backwards compatible with the CLI, as the existing single-part upload endpoints aren't removed.

@jjnesbitt
jjnesbitt requested a review from mvandenburgh August 12, 2026 15:09

@mvandenburgh mvandenburgh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I agree this is cleaner. Overall looks great, just a few bugs and places that need to be updated.

Comment on lines +139 to +144
def abort(self) -> None:
super().abort()

# This upload owns its object key outright, so the object can be deleted along with it
self.blob.delete(save=False)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Things like this make me realize we never implemented a service layer for uploads. Obviously, that's completely out of scope for this change, but it might be worth revisiting at some point.

Comment on lines +34 to +36
def _has_active_uploads(ds: Dandiset) -> bool:
"""Return whether the dandiset has any in-progress asset blob or zarr chunk uploads."""
return ds.uploads.exists() or ZarrUpload.objects.filter(zarr__dandiset=ds).exists()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should also include this logic here https://github.com/dandi/dandi-archive/blob/master/dandiapi/api/views/dandiset.py#L612-L648. The logic below prevents a dandiset with active zarr chunk uploads from being unembargoed on the backend, but the Unembargo button in the UI uses the uploads list endpoint to determine whether to allow clicking it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Along similar lines, there's also this https://github.com/dandi/dandi-archive/blob/master/dandiapi/api/models/version.py#L89-L91, which is used to populate the "active uploads" frontend view.

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.

Your second point is easily fixed via 0ec60be.

The first point however is a bit more intrusive, as now we're mixing two different models within one endpoint. However, we do still need to address it. I'll see what works out best, but we'll have to change that endpoint in some way.

Comment thread dandiapi/zarr/views/upload.py Outdated
@jjnesbitt
jjnesbitt force-pushed the zarr-multipart-flag branch from 9d61609 to 3be87c7 Compare August 13, 2026 18:43
Zarr uploads must be garbage collected differently than regular uploads,
as existing keys can be overwritten.
@jjnesbitt
jjnesbitt force-pushed the zarr-multipart-flag-rework branch from a8d4fd1 to 7c314fb Compare August 13, 2026 18:48
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.

2 participants