diff options
author | Peter Portante <peter.portante@redhat.com> | 2012-10-29 20:43:02 -0400 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2012-11-16 04:46:19 -0800 |
commit | 6bd81f29d9cb6dc7131115629b9b6ca03dff2c4d (patch) | |
tree | 8f2f623d4e0b67f23ea3799ecff142bd109be5cf | |
parent | 7066b4925dd51bdcf0f1eb2db6f455499e69c48b (diff) |
object-storage: only update metadata that changes
See BZ 868120 (https://bugzilla.redhat.com/show_bug.cgi?id=868120)
Change-Id: Ia7f5562cff32eee30c5ca18652d5d9a5a2b18bf4
BUG: 868120
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Reviewed-on: http://review.gluster.org/4173
Reviewed-by: Pete Zaitcev <zaitcev@redhat.com>
Reviewed-by: Mohammed Junaid <junaid@redhat.com>
Tested-by: Kaleb KEITHLEY <kkeithle@redhat.com>
-rw-r--r-- | swift/1.4.8/plugins/DiskDir.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/swift/1.4.8/plugins/DiskDir.py b/swift/1.4.8/plugins/DiskDir.py index e0d5eb77756..a9e39fd4c4f 100644 --- a/swift/1.4.8/plugins/DiskDir.py +++ b/swift/1.4.8/plugins/DiskDir.py @@ -411,8 +411,13 @@ class DiskDir(DiskCommon): self.unlink() def update_metadata(self, metadata): - self.metadata.update(metadata) - write_metadata(self.datadir, self.metadata) + assert self.metadata, "Valid container/account metadata should have been created by now" + if metadata: + new_metadata = self.metadata.copy() + new_metadata.update(metadata) + if new_metadata != self.metadata: + write_metadata(self.datadir, new_metadata) + self.metadata = new_metadata class DiskAccount(DiskDir): |