]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: run resharding thread only on master zone
authorOrit Wasserman <owasserm@redhat.com>
Sun, 28 May 2017 07:42:54 +0000 (10:42 +0300)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 5 Jun 2017 20:18:01 +0000 (13:18 -0700)
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
src/rgw/rgw_rados.cc

index 38bf77a89f42f0a34ececaf54e0f33e7994b2cc6..cabf60dcc7e22072fbcaa03eeaa51b322c83f2a2 100644 (file)
@@ -4385,7 +4385,7 @@ int RGWRados::init_complete()
     zone_id_by_name[z.name] = id;
     zone_by_id[id] = z;
   }
-  
+
   if (zone_by_id.find(zone_id()) == zone_by_id.end()) {
     ldout(cct, 0) << "WARNING: could not find zone config in zonegroup for local zone (" << zone_id() << "), will use defaults" << dendl;
   }
@@ -4543,7 +4543,10 @@ int RGWRados::init_complete()
   reshard_wait = std::make_shared<RGWReshardWait>(this);
 
   reshard = new RGWReshard(this);
-  if (run_reshard_thread) {
+
+  /* only the master zone in the zonegroup reshards buckets */
+  run_reshard_thread = run_reshard_thread && (get_zonegroup().master_zone == zone_public_config.id);
+  if (run_reshard_thread)  {
     reshard->start_processor();
   }