relinking from next part power partition fails to makedir during PUT

Bug #1917655 reported by Alistair Coles
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Committed
Undecided
Alistair Coles

Bug Description

This exception was seen during a partition power increase:

object-server: err Relinking <path> to <path> failed: [Errno 17] File exists: '<path>':
 Traceback (most recent call last):
   File "/opt/ss/lib/python2.7/site-packages/swift/obj/diskfile.py", line 1845, in _finalize_put
     relink_paths(target_path, new_target_path)
   File "/opt/ss/lib/python2.7/site-packages/swift/obj/diskfile.py", line 462, in relink_paths
     os.makedirs(new_target_dir)
   File "/opt/ss/lib/python2.7/os.py", line 157, in makedirs
     mkdir(name, mode)
 OSError: [Errno 17] File exists: '<path>'

It would appear that there were two concurrent PUTs to the same path during the relinking phase of a partition power increase. Both attempt to create the object dir in the new (next partition power) dir but one fails when the dir already exists: the 'look before you leap' check before os.makedirs in diskfile.relink_paths was not sufficient when the requests were concurrent.

If the relinker has already processed (relinked) the old partition, then the failure to create the link from the next part power dir can result in object data that is not relinked to the next part power.

Revision history for this message
Alistair Coles (alistair-coles) wrote :
Changed in swift:
assignee: nobody → Alistair Coles (alistair-coles)
status: New → In Progress
Changed in swift:
status: In Progress → Fix Committed
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.