A question about the return code of write

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,
We are very confused with two problem of rmw.

1. the return code of read is not handled.

The callback of read is like this.
ECBackend::try_state_to_reads
    ...
    objects_read_async_no_cache(
        op->remote_read,
        [this, op](map<hobject_t,pair<int, extent_map> > &&results) {
            for (auto &&i: results) {
                op->remote_read_result.emplace(i.first, i.second.second);
            }
            check_ops();
      });

The read return code in pair<int, extent_map> is never considered.
Shall we detect the return code and cancel the write op immediately, if
there are read errors, to prevent later assert?

2. the return code of write is always 0.
The write op reply is like this.

PrimaryLogPG::execute_ctx
    ...
    ctx->reply = new MOSDOpReply(m, 0, get_osdmap()->get_epoch(), 0,
        successful_write);
    ...
    ctx->register_on_commit(
    [m, ctx, this](){
        ...
        if (m && !ctx->sent_reply) {
            MOSDOpReply *reply = ctx->reply;
            if (reply)
                ctx->reply = nullptr;
            else {
                reply = new MOSDOpReply(m, 0,
get_osdmap()->get_epoch(), 0, true);
                reply->set_reply_versions(ctx->at_version,
                        ctx->user_at_version);
            }
            osd->send_message_osd_client(reply, m->get_connection());
        }
        ...
    });

We find that the return code of write will always 0, if there is no
error occured
at the stage of prepare_transaction.
Shall we return an error code to tell the client there are something
bad happend?



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux