作者 伍增田 Tommy WU
我们环境用的是纠删码存储方式,openstack-swift-object-reconstructor运行时偶尔出现下面的error,隐藏深,化了好长时间才找到根源:
#012Traceback (most recent call last):#012 File “/usr/lib/python2.7/site-packages/swift/obj/server.py”, line 1135, in call#012
res = getattr(self, req.method)(req)#012 File “/usr/lib/python2.7/site-packages/swift/common/utils.py”, line 1658, in _timing_stats#012
resp = func(ctrl, *args, **kwargs)
#012 File “/usr/lib/python2.7/site-packages/swift/obj/server.py”, line 839, in PUT
#012 writer.put(metadata)#012 File “/usr/lib/python2.7/site-packages/swift/obj/diskfile.py”, line 2900, in put
#012 super(ECDiskFileWriter, self)._put(metadata, cleanup, frag_index=fi)
#012 File “/usr/lib/python2.7/site-packages/swift/obj/diskfile.py”, line 1618, in _put #012
tpool_reraise(self._finalize_put, metadata, target_path, cleanup)#012 File “/usr/lib/python2.7/site-packages/swift/common/utils.py”, line 3599, in tpool_reraise#012
raise resp#012OSError: [Errno 2] No such file or directory (txn: tx591bff09b9cd4d3e9aa6e-006088bb50)
reconstructor.py
def collect_parts(self, override_devices=None, override_partitions=None):
tmp_path = join(dev_path, get_tmp_dir(int(policy)))
**unlink_older_than(tmp_path, time.time() -
df_mgr.reclaim_age)**
reclaim_age设置小了, swift-object-reconstructor可能会删除掉正在put的对象, 由于对象是先写在temp目录下的.
disk_file.create(size=fsize) as writer:
fd, tmppath = self._get_tempfile()