Error in unit tests, when xattr have length more than 254.

Bug #1079131 reported by Vladimir Vechkanov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Low
Vladimir Vechkanov

Bug Description

Unit tests for object-server. For example such tests as "test_PUT_overwrite", "test_PUT_user_metadata", "test_manifest_header" returns "EOFError" when xattrs have length more than 254 bytes.

The reason is that swift writes pikled xattr in parts, 254 bytes each. So while reading it we should concatenate several parts. But unit test just read only first part and try to unpikle it. It works while xattrs were less than 254 bits, but when they are longer it causes the error.

Changed in swift:
assignee: nobody → Vladimir Vechkanov (vvechkanov)
Revision history for this message
Samuel Merritt (torgomatic) wrote :

So is there some condition under which those unit tests fail? I mean, if the test is always putting in a small enough amount of metadata that it all fits in one attribute, and then only pulling out one attribute, then what's the problem?

Changed in swift:
assignee: Vladimir Vechkanov (vvechkanov) → nobody
Revision history for this message
Vladimir Vechkanov (vvechkanov) wrote :
Revision history for this message
Vladimir Vechkanov (vvechkanov) wrote :

So you think that it's not a bug?
We are adding a new functional to a Swift and added some new file's attributes. So metadata became longer and we got an error. The reason which we found is in using incorrect function in unit test. Not special "read_metadata" function from object-server used, but a standard getxattr function. We decided that some other developers may encounter this problem and it should be fixed in upstream.
But if you think that it's not a bug, we can fix this problem, when we'll push our functional into upstream.

In any case I add patch which change getxattr functions in test_server.py to read_metadata function.

Revision history for this message
Samuel Merritt (torgomatic) wrote :

I think it's a good idea to wait until you're ready to submit the entire change upstream, and then the reason for the test change will be obvious.

If you submit the test change on its own, I predict that it will either be ignored in Gerrit or you'll get other people asking why you're making changes to an already-passing test. That's just my guess, though, so do what you like. :)

Chuck Thier (cthier)
Changed in swift:
importance: Undecided → Low
Chuck Thier (cthier)
Changed in swift:
status: New → Triaged
Changed in swift:
assignee: nobody → Vladimir Vechkanov (vvechkanov)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (master)

Fix proposed to branch: master
Review: https://review.openstack.org/25131

Changed in swift:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.openstack.org/25131
Committed: http://github.com/openstack/swift/commit/9e3d2f6ea8a2be7d1162711f59017ac87fe71b9e
Submitter: Jenkins
Branch: master

commit 9e3d2f6ea8a2be7d1162711f59017ac87fe71b9e
Author: Vladimir Vechkanov <email address hidden>
Date: Fri Mar 22 17:02:13 2013 +0400

    Fix reading xattrs in object-server's unittests.

    Use for reading metadata in unit tests function from object-server.

    Change-Id: I2bfeb76fdd775442a0e614fef740b0987fba4a22
    Fixes: bug #1079131

Changed in swift:
status: In Progress → Fix Committed
Changed in swift:
milestone: none → 1.9.0
Thierry Carrez (ttx)
Changed in swift:
status: Fix Committed → Fix Released
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.