]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: delete region map after upgrade to zonegroup map 10831/head
authorCasey Bodley <cbodley@redhat.com>
Tue, 23 Aug 2016 19:10:44 +0000 (15:10 -0400)
committerCasey Bodley <cbodley@redhat.com>
Tue, 23 Aug 2016 19:10:46 +0000 (15:10 -0400)
convert_regionmap() reads the region map and uses it to initialize the
zonegroup map.  but it doesn't remove the region_map afterwards, so
radosgw (and some radosgw-admin commands) will keep doing this on
startup, overwriting any changes made to the period/zonegroup map

Fixes: http://tracker.ceph.com/issues/17051
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_rados.cc

index 437cf3b3cc0988f3291c851609dfee17b8e9e6c4..a9bce82780a19917cfcedfd6e01851ec2a778501 100644 (file)
@@ -3310,6 +3310,15 @@ int RGWRados::convert_regionmap()
   current_period.set_user_quota(zonegroupmap.user_quota);
   current_period.set_bucket_quota(zonegroupmap.bucket_quota);
 
+  // remove the region_map so we don't try to convert again
+  rgw_obj obj(pool, oid);
+  ret = delete_system_obj(obj);
+  if (ret < 0) {
+    ldout(cct, 0) << "Error could not remove " << obj
+        << " after upgrading to zonegroup map: " << cpp_strerror(ret) << dendl;
+    return ret;
+  }
+
   return 0;
 }