int ref, rval;
bool released;
bool ack, safe;
- eversion_t objver;
+ version_t objver;
rados_callback_t callback_complete, callback_safe;
- void *callback_arg;
+ void *callback_complete_arg, *callback_safe_arg;
// for read
bool is_read;
AioCompletionImpl() : lock("AioCompletionImpl lock", false, false),
ref(1), rval(0), released(false), ack(false), safe(false),
- callback_complete(0), callback_safe(0), callback_arg(0),
+ objver(0),
+ callback_complete(0),
+ callback_safe(0),
+ callback_complete_arg(0),
+ callback_safe_arg(0),
is_read(false), pbl(0), buf(0), maxlen(0),
io(NULL), aio_write_seq(0), aio_write_list_item(this) { }
return;
}
- eversion_t oldv = pg_log.get_log().get_request_version(ctx->reqid);
- if (oldv != eversion_t()) {
+ const pg_log_entry_t *entry = pg_log.get_log().get_request(ctx->reqid);
+ if (entry) {
+ const eversion_t& oldv = entry->version;
dout(3) << "do_op dup " << ctx->reqid << " was " << oldv << dendl;
delete ctx;
- put_object_context(obc);
- put_object_contexts(src_obc);
+ src_obc.clear();
if (already_complete(oldv)) {
- osd->reply_op_error(op, 0, oldv);
+ osd->reply_op_error(op, 0, oldv, entry->user_version);
} else {
if (m->wants_ack()) {
if (already_ack(oldv)) {
uint64_t cookie = op.watch.cookie;
bool do_watch = op.watch.flag & 1;
entity_name_t entity = ctx->reqid.name;
- ObjectContext *obc = ctx->obc;
+ ObjectContextRef obc = ctx->obc;
- dout(10) << "watch: ctx->obc=" << (void *)obc << " cookie=" << cookie
+ dout(10) << "watch: ctx->obc=" << (void *)obc.get() << " cookie=" << cookie
<< " oi.version=" << oi.version.version << " ctx->at_version=" << ctx->at_version << dendl;
- dout(10) << "watch: oi.user_version=" << oi.user_version.version << dendl;
+ dout(10) << "watch: oi.user_version=" << oi.user_version<< dendl;
dout(10) << "watch: peer_addr="
<< ctx->op->request->get_connection()->get_peer_addr() << dendl;
// Add log entry
++info.last_update.version;
- pg_log_entry_t e(what, oid, info.last_update, version, osd_reqid_t(), mtime);
+ pg_log_entry_t e(what, oid, info.last_update, version, info.last_user_version, osd_reqid_t(), mtime);
pg_log.add(e);
- ObjectContext *obc = get_object_context(oid, true);
+ ObjectContextRef obc = get_object_context(oid, true);
obc->ondisk_write_lock();
op(_op), reqid(_reqid), ops(_ops), obs(_obs), snapset(0),
new_obs(_obs->oi, _obs->exists),
modify(false), user_modify(false),
- bytes_written(0), bytes_read(0),
+ bytes_written(0), bytes_read(0), user_at_version(0),
current_osd_subop_num(0),
- obc(0), clone_obc(0), snapset_obc(0), data_off(0), reply(NULL), pg(_pg),
+ data_off(0), reply(NULL), pg(_pg),
num_read(0),
num_write(0) {
if (_ssc) {