Version overwrite of an object with max length name fails

Bug #1566124 reported by Janie Richling
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Confirmed
Undecided
Unassigned

Bug Description

Put an object with a name of the configured max_object_name_length for the first time in a versioned container - get 200 (success). (default max length is 1024)
Put again creating a new version of the object (overwrite) - get error 412 precondition failed.

This happens because there is a timestamp added to the object name when added to the X-Versions-Location, which causes the name to exceed the maximum length allowed. If it is determined that the versioning behavior cannot change, then the deviation could be documented. Alternatively, changes could be made in order to override the name length check in the versioning middleware. A similar concept has been implemented on feature/crypto because encrypting values can cause metadata values to exceed max length.

A quick example of a functional test that reveals the issue can be found at: https://gist.github.com/anonymous/bd58faa481ba72a90d17063484b01bb7

This can be reproduced on master.

Revision history for this message
John Dickinson (notmyname) wrote :

I'd support bypassing the name length check for versioned objects (but this, of course, would need to be documented for deployers). This is the best end-user experience (and doesn't break anything for users).

Revision history for this message
Janie Richling (jrichli) wrote :

It turns out that the support for allowing middleware to bypass constraint checking was abandoned https://review.openstack.org/#/c/328207/. There was some resistance to allowing for this bypass. For encryption, we made use of transmeta in the end to solve this problem. So, I am not sure how resolve this particular issue.

Revision history for this message
Tim Burke (1-tim-z) wrote :

I think I'd still be in favor of allowing middleware to bypass the *just* the name length check (maybe up to twice the max_object_name_length or something?).

I think the concern with the abandoned patch was largely limited to metadata, and in particular the possibility of one middleware bypassing the check then passing the request along to another (broken) middleware that inserts way too much metadata.

I'd feel more comfortable bypassing the name length check because

* middlewares don't mess with path info much (swift3 and bulk upload are the only two exceptions I can think of off-hand) and
* as long as we still have *some* hard cap, the potential for abuse is fairly minimal.

Janie Richling (jrichli)
Changed in swift:
assignee: nobody → Janie Richling (jrichli)
Revision history for this message
Matthew Oliver (matt-0) wrote :

Janie, are you still working on this.. I'll assume you are and change it to 'In Progress', but feel free to change it back or whatever if your not/can't or whatever :)

Changed in swift:
status: New → In Progress
status: In Progress → Confirmed
Revision history for this message
Matthew Oliver (matt-0) wrote :

Actually, I'll change it to confirmed, as you may be working on it.. and I can see it is a problem.

Revision history for this message
Janie Richling (jrichli) wrote :

Hey Matt! I have not yet started this, actually. I will open it up for others, but will come back to it later if I can. Thanks!

Changed in swift:
assignee: Janie Richling (jrichli) → nobody
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.