This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit b51f7d1d81179d7be105681adcde00d2fafed943 | |
Author: Clay Gerrard <clay.gerrard@gmail.com> | |
Date: Thu Aug 27 15:09:29 2015 -0700 | |
wip: fix tombstone purge | |
Change-Id: Ib9a42f412fb90d51959efce886c0f8952aba8d85 | |
diff --git a/swift/obj/diskfile.py b/swift/obj/diskfile.py | |
index 51158a0..eb32703 100644 | |
--- a/swift/obj/diskfile.py | |
+++ b/swift/obj/diskfile.py | |
@@ -2164,7 +2164,11 @@ class ECDiskFile(BaseDiskFile): | |
:class:`~swift.common.utils.Timestamp` | |
:param frag_index: a fragment archive index, must be a whole number. | |
""" | |
- for ext in ('.data', '.ts'): | |
+ exts = ['.ts'] | |
+ # when frag_index is None it's not possible to build a data file name | |
+ if frag_index is not None: | |
+ exts.append('.data') | |
+ for ext in exts: | |
purge_file = self.manager.make_on_disk_filename( | |
timestamp, ext=ext, frag_index=frag_index) | |
remove_file(os.path.join(self._datadir, purge_file)) | |
diff --git a/swift/obj/reconstructor.py b/swift/obj/reconstructor.py | |
index 99e964c..31b4698 100644 | |
--- a/swift/obj/reconstructor.py | |
+++ b/swift/obj/reconstructor.py | |
@@ -542,6 +542,9 @@ class ObjectReconstructor(Daemon): | |
frag_index=frag_index) | |
df.purge(Timestamp(timestamp), frag_index) | |
except DiskFileError: | |
+ self.logger.exception( | |
+ 'Unable to purge DiskFile (%r %r %r)', | |
+ object_hash, timestamp, frag_index) | |
continue | |
def process_job(self, job): |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment