Moved some HPSS-specific things from the ObjectServer into the DiskFile, where it belongs.
Also, fixed an issue with object uploads failing due to ETag calculation not keeping up.
This commit is contained in:
parent
2b7b787d56
commit
ef2d07ea48
@ -397,18 +397,19 @@ class DiskFileWriter(object):
|
||||
self.close()
|
||||
|
||||
# TODO: see if this is really the right way of getting the ETag
|
||||
# TODO: add timeout in case we should end up never having an ETag
|
||||
if not has_etag:
|
||||
sleep(.5)
|
||||
try:
|
||||
xattrs = xattr.xattr(df._data_file)
|
||||
if 'system.hpss.hash' in xattrs:
|
||||
etag = xattrs['system.hpss.hash']
|
||||
elif 'user.hash.checksum' in xattrs:
|
||||
etag = xattrs['user.hash.checksum']
|
||||
else:
|
||||
raise DiskFileError(
|
||||
'ETag was not in HPSS xattrs for file %s'
|
||||
% df._data_file)
|
||||
etag = None
|
||||
# We sit here and wait until hpssfs-cksum finishes calculating
|
||||
# the checksum.
|
||||
while etag is None:
|
||||
time.sleep(.25)
|
||||
xattrs = xattr.xattr(df._data_file)
|
||||
if 'system.hpss.hash' in xattrs:
|
||||
etag = xattrs['system.hpss.hash']
|
||||
elif 'user.hash.checksum' in xattrs:
|
||||
etag = xattrs['user.hash.checksum']
|
||||
metadata['ETag'] = etag
|
||||
write_metadata(df._data_file, metadata)
|
||||
except IOError as err:
|
||||
|
@ -398,7 +398,6 @@ class ObjectController(server.ObjectController):
|
||||
@public
|
||||
@timing_stats()
|
||||
def GET(self, request):
|
||||
logging.error(request)
|
||||
"""Handle HTTP GET requests for the Swift on File object server"""
|
||||
device, partition, account, container, obj, policy = \
|
||||
get_name_and_placement(request, 5, 5, True)
|
||||
@ -460,8 +459,8 @@ class ObjectController(server.ObjectController):
|
||||
headers = {}
|
||||
if hasattr(e, 'timestamp'):
|
||||
headers['X-Backend-Timestamp'] = e.timestamp.internal
|
||||
return HTTPNotFound(request=request, headers=headers,
|
||||
conditional_response=True)
|
||||
return HTTPNotFound(request=request, headers=headers,
|
||||
conditional_response=True)
|
||||
|
||||
@public
|
||||
@timing_stats()
|
||||
|
Loading…
x
Reference in New Issue
Block a user