]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: clear old zone short ids on period update 14141/head
authorCasey Bodley <cbodley@redhat.com>
Thu, 9 Mar 2017 20:24:08 +0000 (15:24 -0500)
committerNathan Cutler <ncutler@suse.com>
Sat, 25 Mar 2017 10:57:54 +0000 (11:57 +0100)
the short ids of old, removed zones were being kept in the period to
guard against hash collisions with new zones

but for a hash collision to cause a wrong object to sync, that object
would have to be uploaded simultaneously to two different zones that had
the same short id

to avoid this, we just have to prevent the period from containing two
colliding zones at the same time - we don't have to remember old zone
short ids forever

Fixes: http://tracker.ceph.com/issues/15618
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 9c45633c836c966ab1f75ea2b1ad3fa0a4886600)

src/rgw/rgw_rados.cc

index 4f7af0f4785eada203efe323cecedfc0687d6e66..3d3712c4b27153442a77bfec831e1b60a83e81b1 100644 (file)
@@ -1220,6 +1220,10 @@ int RGWPeriod::update()
     return ret;
   }
 
+  // clear zone short ids of removed zones. period_map.update() will add the
+  // remaining zones back
+  period_map.short_zone_ids.clear();
+
   for (auto& iter : zonegroups) {
     RGWZoneGroup zg(string(), iter);
     ret = zg.init(cct, store);