Whamcloud - gitweb
EX-9183 llog: debug for llog cancel problems
authorMikhail Pershin <mpershin@whamcloud.com>
Sat, 18 May 2024 19:43:05 +0000 (22:43 +0300)
committerAndreas Dilger <adilger@whamcloud.com>
Wed, 19 Jun 2024 05:38:53 +0000 (05:38 +0000)
- add debug messages for update_log_dir remote access
  errors
- remove former extended debug for -ENOTDIR error

Fixes: 00548f792a ("EX-3860 llog: extended debug for -ENOTDIR error")
Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Change-Id: Ifb87489cc76f10814eb12eba0a4ae997293fa11d
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/55389
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/obdclass/dt_object.c
lustre/target/out_handler.c
lustre/target/update_trans.c

index d4760f6..ed6b009 100644 (file)
@@ -190,10 +190,10 @@ int dt_try_as_dir(const struct lu_env *env, struct dt_object *obj, bool check)
 {
        if (check) {
                if (unlikely(!dt_object_exists(obj)))
-                       RETURN(0);
+                       return 0;
 
                if (unlikely(!S_ISDIR(lu_object_attr(&obj->do_lu))))
-                       RETURN(0);
+                       return 0;
 
                if (obj->do_index_ops)
                        return 1;
@@ -201,7 +201,6 @@ int dt_try_as_dir(const struct lu_env *env, struct dt_object *obj, bool check)
 
        obj->do_ops->do_index_try(env, obj, &dt_directory_features);
 
-       EXIT;
        return obj->do_index_ops != NULL;
 }
 EXPORT_SYMBOL(dt_try_as_dir);
index 339b2c8..d951e59 100644 (file)
@@ -192,12 +192,16 @@ static int out_attr_get(struct tgt_session_info *tsi)
        struct dt_object        *obj = tti->tti_u.update.tti_dt_object;
        int                     idx = tti->tti_u.update.tti_update_reply_index;
        int                     rc;
+       int level = D_INFO;
 
        ENTRY;
 
        if (unlikely(update->ou_result_size < sizeof(*obdo)))
                return -EPROTO;
 
+       if (fid_is_update_log_dir(lu_object_fid(&obj->do_lu)))
+               level = D_WARNING;
+
        if (!lu_object_exists(&obj->do_lu)) {
                /* Usually, this will be called when the master MDT try
                 * to init a remote object(see osp_object_init), so if
@@ -205,6 +209,8 @@ static int out_attr_get(struct tgt_session_info *tsi)
                 * so the object can be removed from the cache immediately */
                set_bit(LU_OBJECT_HEARD_BANSHEE,
                        &obj->do_lu.lo_header->loh_flags);
+               CDEBUG_LIMIT(level, "%s: update_log_dir is missing?\n",
+                            tgt_name(tsi->tsi_tgt));
                RETURN(-ENOENT);
        }
 
@@ -219,9 +225,9 @@ static int out_attr_get(struct tgt_session_info *tsi)
 out_unlock:
        dt_read_unlock(env, obj);
 
-       CDEBUG(D_INFO, "%s: insert attr get reply %p index %d: rc = %d\n",
-              tgt_name(tsi->tsi_tgt), tti->tti_u.update.tti_update_reply,
-              0, rc);
+       CDEBUG_LIMIT(level, "%s: insert attr get reply %p index %d: rc = %d\n",
+                    tgt_name(tsi->tsi_tgt), tti->tti_u.update.tti_update_reply,
+                    0, rc);
 
        object_update_result_insert(tti->tti_u.update.tti_update_reply, obdo,
                                    sizeof(*obdo), idx, rc);
@@ -1136,12 +1142,14 @@ int out_handle(struct tgt_session_info *tsi)
                        dt_obj = dt_locate_at(env, dt, &update->ou_fid,
                                dt->dd_lu_dev.ld_site->ls_top_dev, &conf);
                        if (IS_ERR(dt_obj)) {
+                               int level = D_HA;
+
                                rc = PTR_ERR(dt_obj);
-                               CDEBUG(D_HA,
-                                      "%s: opc: 0x%x locate error fid"\
-                                      DFID": rc = %d\n",
-                                      tgt_name(tsi->tsi_tgt),
-                                      update->ou_type,
+                               if (fid_is_update_log_dir(&update->ou_fid))
+                                       level = D_WARNING;
+                               CDEBUG_LIMIT(level,
+                                      "%s: opc: 0x%x locate error fid "DFID": rc = %d\n",
+                                      tgt_name(tsi->tsi_tgt), update->ou_type,
                                       PFID(&update->ou_fid), rc);
                                GOTO(out, rc);
                        }
index 900cda1..77f6c4a 100644 (file)
@@ -1281,9 +1281,6 @@ static int distribute_txn_cancel_records(const struct lu_env *env,
                                         struct top_multiple_thandle *tmt)
 {
        struct sub_thandle *st;
-       unsigned int debug = 0;
-       bool debug_done = false;
-
        ENTRY;
 
        if (OBD_FAIL_CHECK(OBD_FAIL_TGT_TXN_NO_CANCEL))
@@ -1306,29 +1303,15 @@ static int distribute_txn_cancel_records(const struct lu_env *env,
                        cookie = &stc->stc_cookie;
                        if (fid_is_zero(&cookie->lgc_lgl.lgl_oi.oi_fid))
                                continue;
-do_debug_run:
+
                        rc = llog_cat_cancel_records(env, ctxt->loc_handle, 1,
                                                     cookie);
                        CDEBUG(D_HA, "%s: batchid %llu cancel update log "
                               DFID".%u: rc = %d\n", obd->obd_name,
                               tmt->tmt_batchid, PLOGID(&cookie->lgc_lgl),
                               cookie->lgc_index, rc);
-                       if (unlikely(rc == -ENOTDIR && !debug_done)) {
-                               if (!debug) {
-                                       debug = libcfs_debug;
-                                       libcfs_debug |= D_TRACE | D_INFO |
-                                                       D_OTHER | D_INODE |
-                                                       D_RPCTRACE;
-                                       goto do_debug_run;
-                               } else {
-                                       libcfs_debug = debug;
-                                       libcfs_debug_dumplog();
-                                       debug_done = true;
-                               }
-                       }
                }
-               if (unlikely(debug && !debug_done))
-                       libcfs_debug = debug;
+
                llog_ctxt_put(ctxt);
        }