]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: always send returnvec-on-errors for client's retry 59273/head
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 14 Feb 2024 00:38:46 +0000 (00:38 +0000)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Sat, 17 Aug 2024 11:04:18 +0000 (18:04 +0700)
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>
(cherry picked from commit 613575719191ce55bc8997577965f3a03e22453c)

src/osd/PrimaryLogPG.cc

index 49178dc406a4dbb6b5d819d25201c95ef44b6084..9e3b28a12f2e4ff6bd063dae176c4377b4534f06 100644 (file)
@@ -4312,8 +4312,11 @@ void PrimaryLogPG::execute_ctx(OpContext *ctx)
     }
     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;
   }