Skip to content

Commit

Permalink
rgw: clear old zone short ids on period update
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
cbodley committed Mar 13, 2017
1 parent b1a2f9f commit 9c45633
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/rgw/rgw_rados.cc
Expand Up @@ -1302,6 +1302,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);
Expand Down

0 comments on commit 9c45633

Please sign in to comment.