Currently there is a discrepancy in terms of the returnvec's
presence between MOSDOpReplys sent for original requests and
those on dups. The former always contain the returnvec if
an error happened, even if `allows_returnvec()` is `false`.
This commit extends the behavior on dups.
For RCA please see: https://tracker.ceph.com/issues/64192#note-9
Fixes: https://tracker.ceph.com/issues/64192
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
}
reply->add_flags(CEPH_OSD_FLAG_ACK | CEPH_OSD_FLAG_ONDISK);
// append to pg log for dup detection - don't save buffers for now
- record_write_error(op, soid, reply, result,
- ctx->op->allows_returnvec() ? ctx : nullptr);
+ // store op's returnvec unconditionally-on-errors to ensure coherency
+ // with the original request handling (see `ignore_out_data` above).
+ record_write_error(
+ op, soid, reply, result,
+ (ctx->op->allows_returnvec() || result < 0) ? ctx : nullptr);
close_op_ctx(ctx);
return;
}