]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: add request result to mutation for analysis by tests
authorPatrick Donnelly <pdonnell@redhat.com>
Wed, 24 Jan 2024 02:27:18 +0000 (21:27 -0500)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 20 Mar 2024 14:56:51 +0000 (10:56 -0400)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mds/Mutation.cc
src/mds/Mutation.h
src/mds/Server.cc

index b52e04a63936ef30d7208f1a515e17a8ec27dfe3..9b71e244e08a4fc52f95e98d3ef645bd2a876ac1 100644 (file)
@@ -472,6 +472,7 @@ void MDRequestImpl::print(ostream &out) const
 void MDRequestImpl::_dump(Formatter *f, bool has_mds_lock) const
 {
   std::lock_guard l(lock);
+  f->dump_int("result", result);
   f->dump_string("flag_point", _get_state_string());
   f->dump_object("reqid", reqid);
   if (client_request) {
index 18266c447c3136fcb723bbd210334f3c949e7378..1a308c423f51b26c85995fdd64e1190932c9bffd 100644 (file)
@@ -15,6 +15,8 @@
 #ifndef CEPH_MDS_MUTATION_H
 #define CEPH_MDS_MUTATION_H
 
+#include <limits>
+
 #include "include/interval_set.h"
 #include "include/elist.h"
 #include "include/filepath.h"
@@ -227,6 +229,7 @@ public:
   void _dump_op_descriptor(std::ostream& stream) const override;
 
   metareqid_t reqid;
+  int result = std::numeric_limits<int>::min();
   __u32 attempt = 0;      // which attempt for this request
   LogSegment *ls = nullptr;  // the log segment i'm committing to
 
index ed42ac439d82a10bc4efc3760d9c286cc34cc74c..598452c32fd428342f97399a169cd0af94ff6dad 100644 (file)
@@ -2073,6 +2073,7 @@ void Server::submit_mdlog_entry(LogEvent *le, MDSLogContextBase *fin, const MDRe
  */
 void Server::respond_to_request(const MDRequestRef& mdr, int r)
 {
+  mdr->result = r;
   if (mdr->client_request) {
     if (mdr->is_batch_head()) {
       dout(20) << __func__ << " batch head " << *mdr << dendl;