}
bool operator<(const rgw_obj& o) const {
- return (bucket.name.compare(o.bucket.name) < 0) ||
- (object.compare(o.object) < 0) ||
- (ns.compare(o.ns) < 0);
+ int r = bucket.name.compare(o.bucket.name);
+ if (r == 0) {
+ r = object.compare(o.object);
+ if (r == 0) {
+ r = ns.compare(o.ns);
+ }
+ }
+
+ return (r < 0);
}
};
WRITE_CLASS_ENCODER(rgw_obj)
int RGWRados::get_obj_state(RGWRadosCtx *rctx, rgw_obj& obj, librados::IoCtx& io_ctx, string& actual_obj, RGWObjState **state)
{
- dout(20) << "get_obj_state: rctx=" << (void *)rctx << " obj=" << obj << dendl;
RGWObjState *s = rctx->get_state(obj);
+ dout(20) << "get_obj_state: rctx=" << (void *)rctx << " obj=" << obj << " state=" << (void *)s << dendl;
*state = s;
if (s->has_attrs)
return 0;
s->shadow_obj[bl.length()] = '\0';
}
s->obj_tag = s->attrset[RGW_ATTR_ID_TAG];
+ if (s->obj_tag.length())
+ dout(20) << "get_obj_state: setting s->obj_tag to " << s->obj_tag.c_str() << dendl;
+ else
+ dout(20) << "get_obj_state: s->obj_tag was set empty" << dendl;
return 0;
}
RGWObjState *state = *pstate;
- if (!state->is_atomic)
+ if (!state->is_atomic) {
+ dout(20) << "state for obj=" << obj << " is not atomic, not appending atomic test" << dendl;
return 0;
+ }
if (state->obj_tag.length() > 0) {// check for backward compatibility
op.cmpxattr(RGW_ATTR_ID_TAG, LIBRADOS_CMPXATTR_OP_EQ, state->obj_tag);
+ } else {
+ dout(20) << "state->obj_tag is empty, not appending atomic test" << dendl;
}
return 0;
}
RGWObjState *state = *pstate;
- if (!state->is_atomic)
+ if (!state->is_atomic) {
+ dout(20) << "prepare_atomic_for_write_impl: state is not atomic. state=" << (void *)state << dendl;
return 0;
+ }
if (state->obj_tag.length() == 0 ||
state->shadow_obj.size() == 0) {
bufferlist bl;
bl.append(tag);
-
op.setxattr(RGW_ATTR_ID_TAG, bl);
string shadow = obj.object;