auto aio = rgw::make_throttle(cct->_conf->rgw_put_obj_min_window_size, y);
using namespace rgw::putobj;
jspan_context no_trace{false, false};
+
+ // bi expects empty instance for the entries created when
+ // bucket versioning is not enabled or suspended.
+ rgw_obj dest_obj_bi = dest_obj;
+ if (dest_obj_bi.key.instance == "null") {
+ dest_obj_bi.key.instance.clear();
+ }
+
rgw::putobj::AtomicObjectProcessor processor(aio.get(), this, dest_bucket_info, nullptr,
- owner, obj_ctx, dest_obj, olh_epoch, tag, dpp, y, no_trace);
+ owner, obj_ctx, dest_obj_bi, olh_epoch, tag, dpp, y, no_trace);
void (*progress_cb)(off_t, void *) = NULL;
void *progress_data = NULL;
*/
int RadosObject::handle_obj_expiry(const DoutPrefixProvider* dpp, optional_yield y) {
int ret = 0;
+
+ /* once bucket versioning is enabled, the non-current entries with
+ * instance empty should have instance set to "null" to be able
+ * to correctly read its olh version entry.
+ */
+ rgw_obj_key& obj_key = get_key();
+ rgw::sal::Bucket* bucket = get_bucket();
+
+ if (obj_key.instance.empty() && bucket->versioned()) {
+ obj_key.instance = "null";
+ }
+
real_time read_mtime;
std::unique_ptr<rgw::sal::Object::ReadOp> read_op(get_read_op());
read_op->params.lastmod = &read_mtime;
- ldpp_dout(dpp, 20) << "Entering handle_obj_expiry Obj:" << get_key() << dendl;
-
ret = read_op->prepare(y, dpp);
if (ret < 0) {
ldpp_dout(dpp, -1) << "handle_obj_expiry Obj:" << get_key() <<
return ret;
}
+ if (obj_key.instance == "null") {
+ obj_key.instance.clear();
+ }
+
set_atomic();
map<string, bufferlist> attrs = get_attrs();
RGWRados::Object op_target(store->getRados(), bucket->get_info(), *rados_ctx, get_obj());