Concurrent uploads to same object

Bug #1133069 reported by rehanift
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Won't Fix
Wishlist
Unassigned

Bug Description

2 files, one large (10M) and one small (1k).

Start uploading larger object, then start uploading smaller object. Both objects are writing to the same object URL

Small object finishes uploading and responds with small object's MD5 in ETag. Describing the object reproduces again the small object's MD5 in ETag. Large object is still uploading

Large object finishes uploading and responds with large objects large object's MD5 in ETag. Describing the object now responds with small object's MD5 in ETag.

I would expect the large object to respond with an error and/or with the small object's MD5 in the ETag header.

I reproduced this on Essex.

description: updated
Revision history for this message
Mike Barton (redbo) wrote :

Yep, uploads are given a timestamp when they start, and whichever has the newest timestamp wins.

It should be possible to make the larger upload respond with an error when it's thrown away.

Revision history for this message
rehanift (rehan-iftikhar) wrote :

Is this a confirmed bug then? Or should this become a feature request?

Mike Barton (redbo)
Changed in swift:
status: New → Confirmed
importance: Undecided → Wishlist
Revision history for this message
Tong Li (litong01) wrote :

this is actually how Swift behaves. If the versioning is turned on, these actions make two versions. It should not be a bug. If will be
a bug if the two uploads actually mixed up the content into one version. I suggest to close this one without action.

Revision history for this message
Mike Barton (redbo) wrote :

I think returning an error if your upload is thrown away at the end is sort of reasonable.

Revision history for this message
Kun Huang (academicgareth) wrote :

@Mike
How do I know my upload is thrown away? Is there maybe a *.lock?

Revision history for this message
Christian Schwede (cschwede) wrote :

Due to the eventual consistency one can't ensure to return the smallers object etag when finishing the larger upload.

Let's assume the smaller upload used some handoff nodes (for whatever reason), and the small upload finished.
The larger upload is still in progress, and finally finishes too. Now the server checks if the stored etag is identical to the uploaded data - and returns the etag of the larger object, because that is the object stored on the primary nodes.

Now the client requests the etag again. In the meantime the replicators moved the smaller object from the handoffs to the primary nodes, and now you're getting the etag of the smaller object.

From my point of view this is just how Swift works - thus I'm closing the bug, because due to the eventual consistency there is no way to be sure which object is the newest in the cluster.

Changed in swift:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.