}
struct rgw_bucket_category_stats& stats =
header.stats[cur_change.meta.category];
+ bool log_op = (op & CEPH_RGW_DIR_SUGGEST_LOG_OP) != 0;
+ op &= CEPH_RGW_DIR_SUGGEST_OP_MASK;
switch(op) {
case CEPH_RGW_REMOVE:
CLS_LOG(10, "CEPH_RGW_REMOVE name=%s instance=%s\n", cur_change.key.name.c_str(), cur_change.key.instance.c_str());
ret = cls_cxx_map_remove_key(hctx, cur_change_key);
if (ret < 0)
return ret;
+ if (log_op && cur_disk.exists) {
+ ret = log_index_operation(hctx, cur_disk.key, CLS_RGW_OP_DEL, cur_disk.tag, cur_disk.meta.mtime,
+ cur_disk.ver, CLS_RGW_STATE_COMPLETE, header.ver, header.max_marker, 0, NULL, NULL);
+ if (ret < 0) {
+ CLS_LOG(0, "ERROR: %s(): failed to log operation ret=%d", __func__, ret);
+ return ret;
+ }
+ }
break;
case CEPH_RGW_UPDATE:
CLS_LOG(10, "CEPH_RGW_UPDATE name=%s instance=%s total_entries: %" PRId64 " -> %" PRId64 "\n",
ret = cls_cxx_map_set_val(hctx, cur_change_key, &cur_state_bl);
if (ret < 0)
return ret;
+ if (log_op) {
+ ret = log_index_operation(hctx, cur_change.key, CLS_RGW_OP_ADD, cur_change.tag, cur_change.meta.mtime,
+ cur_change.ver, CLS_RGW_STATE_COMPLETE, header.ver, header.max_marker, 0, NULL, NULL);
+ if (ret < 0) {
+ CLS_LOG(0, "ERROR: %s(): failed to log operation ret=%d", __func__, ret);
+ return ret;
+ }
+ }
break;
}
}
+
}
if (header_changed) {
librados::IoCtx index_ctx;
string dir_oid;
+ uint8_t suggest_flag = (get_zone().log_data ? CEPH_RGW_DIR_SUGGEST_LOG_OP : 0);
+
int r = open_bucket_index(bucket, index_ctx, dir_oid);
if (r < 0)
return r;
rgw_bucket_dir_entry entry;
entry.ver.epoch = (uint64_t)-1; // ULLONG_MAX, needed to that objclass doesn't skip out request
key.transform(&entry.key);
- updates.append(CEPH_RGW_REMOVE);
+ updates.append(CEPH_RGW_REMOVE | suggest_flag);
::encode(entry, updates);
}
RGWObjEnt& object,
bufferlist& suggested_updates)
{
+ uint8_t suggest_flag = (get_zone().log_data ? CEPH_RGW_DIR_SUGGEST_LOG_OP : 0);
+
rgw_obj obj;
std::string oid, instance, loc, ns;
rgw_obj_key key;
list_state.meta.owner_display_name = owner.get_display_name();
list_state.exists = true;
- cls_rgw_encode_suggestion(CEPH_RGW_UPDATE, list_state, suggested_updates);
+ cls_rgw_encode_suggestion(CEPH_RGW_UPDATE | suggest_flag, list_state, suggested_updates);
return 0;
}