waiting_on = ranges.size();
ContentsGenerator::iterator gen_pos = cont_gen->get_iterator(cont);
- uint64_t tid = 1;
+ // assure that tid is greater than last_acked_tid
+ uint64_t tid = last_acked_tid + 1;
for (auto [offset, len] : ranges) {
gen_pos.seek(offset);
bufferlist to_write = gen_pos.gen_bl_advance(len);
<< " to " << len + offset << " tid " << tid << std::endl;
auto cb_arg =
new pair<TestOp*, TestOp::CallbackInfo*>(this,
- new TestOp::CallbackInfo(tid));
+ new TestOp::CallbackInfo(tid++));
librados::AioCompletion *completion =
context->rados.aio_create_completion((void*) cb_arg, &write_callback);
waiting.insert(completion);
} else {
op.write(offset, to_write);
}
- if (do_excl && tid == 1)
+ if (do_excl && cb_arg->second->id == last_acked_tid + 1)
op.assert_exists();
context->io_ctx.aio_operate(
context->prefix+oid, completion,
&op);
- ++tid;
}
bufferlist contbl;
pair<TestOp*, TestOp::CallbackInfo*> *cb_arg =
new pair<TestOp*, TestOp::CallbackInfo*>(
this,
- new TestOp::CallbackInfo(++tid));
+ new TestOp::CallbackInfo(tid++));
librados::AioCompletion *completion = context->rados.aio_create_completion(
(void*) cb_arg, &write_callback);
waiting.insert(completion);
cb_arg =
new pair<TestOp*, TestOp::CallbackInfo*>(
this,
- new TestOp::CallbackInfo(++tid));
+ new TestOp::CallbackInfo(tid++));
rcompletion = context->rados.aio_create_completion(
(void*) cb_arg, &write_callback);
waiting_on++;
waiting_on = ranges.size();
ContentsGenerator::iterator gen_pos = cont_gen->get_iterator(cont);
- uint64_t tid = 1;
+ // assure that tid is greater than last_acked_tid
+ uint64_t tid = last_acked_tid + 1;
for (auto [offset, len] : ranges) {
gen_pos.seek(offset);
bufferlist to_write = gen_pos.gen_bl_advance(len);
<< " to " << offset + len << " tid " << tid << std::endl;
auto cb_arg =
new pair<TestOp*, TestOp::CallbackInfo*>(this,
- new TestOp::CallbackInfo(tid));
+ new TestOp::CallbackInfo(tid++));
librados::AioCompletion *completion =
context->rados.aio_create_completion((void*) cb_arg,
&write_callback);
context->io_ctx.aio_operate(
context->prefix+oid, completion,
&op);
- ++tid;
}
bufferlist contbl;
pair<TestOp*, TestOp::CallbackInfo*> *cb_arg =
new pair<TestOp*, TestOp::CallbackInfo*>(
this,
- new TestOp::CallbackInfo(++tid));
+ new TestOp::CallbackInfo(tid++));
librados::AioCompletion *completion = context->rados.aio_create_completion(
(void*) cb_arg, &write_callback);
waiting.insert(completion);
cb_arg =
new pair<TestOp*, TestOp::CallbackInfo*>(
this,
- new TestOp::CallbackInfo(++tid));
+ new TestOp::CallbackInfo(tid++));
rcompletion = context->rados.aio_create_completion(
(void*) cb_arg, &write_callback);
waiting_on++;