Skip to content

Commit

Permalink
rgw: add missing metadata_heap pool to old zones
Browse files Browse the repository at this point in the history
Fixes: http://tracker.ceph.com/issues/15937

Signed-off-by: Orit Wasserman <owasserm@redhat.com>
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit b79856b)
  • Loading branch information
oritwas authored and theanalyst committed May 24, 2016
1 parent 99f6102 commit e78b215
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/rgw/rgw_rados.cc
Expand Up @@ -3331,6 +3331,17 @@ int RGWRados::replace_region_with_zonegroup()
ldout(cct, 0) << "failed to list regions: ret "<< ret << " " << cpp_strerror(-ret) << dendl;
return ret;
} else if (ret == -ENOENT || regions.empty()) {
RGWZoneParams zoneparams(default_zone_name);
int ret = zoneparams.init(cct, this);
if (ret < 0 && ret != -ENOENT) {
ldout(cct, 0) << __func__ << ": error initializing default zone params: " << cpp_strerror(-ret) << dendl;
return ret;
}
/* default zone is missing meta_heap */
if (ret != -ENOENT && zoneparams.metadata_heap.name.empty()) {
zoneparams.metadata_heap = ".rgw.meta";
return zoneparams.update();
}
return 0;
}

Expand Down Expand Up @@ -3431,6 +3442,9 @@ int RGWRados::replace_region_with_zonegroup()
ldout(cct, 0) << "failed to init zoneparams " << iter->first << ": " << cpp_strerror(-ret) << dendl;
return ret;
}
if (zoneparams.metadata_heap.name.empty()) {
zoneparams.metadata_heap = ".rgw.meta";
}
zonegroup.realm_id = realm.get_id();
ret = zoneparams.update();
if (ret < 0 && ret != -EEXIST) {
Expand Down

0 comments on commit e78b215

Please sign in to comment.