From 8c67ed14e891d23c8e41d1e71e3e569c168bdde5 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 19 Sep 2016 11:41:20 -0400 Subject: [PATCH] Delete empty swift chunks Fixes #1844 --- storage/swift.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/storage/swift.py b/storage/swift.py index 597ea966b..808794868 100644 --- a/storage/swift.py +++ b/storage/swift.py @@ -287,6 +287,9 @@ class SwiftStorage(BaseStorage): if bytes_written > 0: updated_metadata[_SEGMENTS_KEY].append(_PartUploadMetadata(segment_path, offset, bytes_written)) + else: + # Delete the empty segment. + self.remove(segment_path) return bytes_written, updated_metadata