]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix zone did't update realm_id when added to zonegroup 12139/head
authorTianshan Qu <tianshan@xsky.com>
Tue, 22 Nov 2016 10:53:05 +0000 (18:53 +0800)
committerTianshan Qu <tianshan@xsky.com>
Tue, 22 Nov 2016 17:01:03 +0000 (01:01 +0800)
Fixes: http://tracker.ceph.com/issues/17995
Signed-off-by: Tianshan Qu <tianshan@xsky.com>
src/rgw/rgw_admin.cc

index ab0b94d805bd61975b3bc586556faff5c7ebc8c4..2b2f8ffa287ab6304fc2b75040a7e2f5a28936ca 100644 (file)
@@ -3135,6 +3135,15 @@ int main(int argc, char **argv)
          cerr << "unable to initialize zone: " << cpp_strerror(-ret) << std::endl;
          return -ret;
        }
+        if (zone.realm_id != zonegroup.realm_id) {
+          zone.realm_id = zonegroup.realm_id;
+          ret = zone.update();
+          if (ret < 0) {
+            cerr << "failed to save zone info: " << cpp_strerror(-ret) << std::endl;
+            return -ret;
+          }
+        }
+
         string *ptier_type = (tier_type_specified ? &tier_type : nullptr);
         zone.tier_config = tier_config_add;