cerr << "Error updating period epoch: " << cpp_strerror(ret) << std::endl;
return ret;
}
+ ret = period.reflect();
+ if (ret < 0) {
+ cerr << "Error updating local objects: " << cpp_strerror(ret) << std::endl;
+ return ret;
+ }
realm.notify_new_period(period);
return ret;
}
::encode(info, bl);
- int ret = rgw_put_system_obj(store, pool, oid, bl.c_str(), bl.length(), false, NULL, 0, NULL);
- if (ret < 0)
- return ret;
-
- ret = reflect();
- if (ret < 0) {
- ldout(cct, 0) << "ERROR: period.reflect(): " << cpp_strerror(-ret) << dendl;
- return ret;
- }
-
- return 0;
+ return rgw_put_system_obj(store, pool, oid, bl.c_str(), bl.length(), false, NULL, 0, NULL);
}
int RGWPeriod::delete_obj()
lderr(cct) << "failed to set latest epoch: " << cpp_strerror(-r) << dendl;
return r;
}
+ r = reflect();
+ if (r < 0) {
+ lderr(cct) << "failed to update local objects: " << cpp_strerror(-r) << dendl;
+ return r;
+ }
ldout(cct, 4) << "Committed new epoch " << epoch
<< " for period " << id << dendl;
realm.notify_new_period(*this);
lderr(cct) << "failed to set latest epoch" << dendl;
return;
}
+ // reflect the period into our local objects
+ http_ret = period.reflect();
+ if (http_ret < 0) {
+ lderr(cct) << "failed to update local objects: "
+ << cpp_strerror(-http_ret) << dendl;
+ return;
+ }
ldout(cct, 4) << "period epoch " << period.get_epoch()
<< " is newer than current epoch " << current_period.get_epoch()
<< ", updating latest epoch and notifying zone" << dendl;