Whamcloud - gitweb
LU-14057 ptlrpc: don't log connection 'restored' inappropriately 31/40331/3
authorAurelien Degremont <degremoa@amazon.com>
Fri, 16 Oct 2020 13:42:42 +0000 (13:42 +0000)
committerOleg Drokin <green@whamcloud.com>
Tue, 3 Nov 2020 03:40:40 +0000 (03:40 +0000)
Reverse imports maintain a target->client connection which
does not support recovery as client don't run a recovery.
At every connection, the reverse import state goes from
NEW to RECOVER to FULL which triggers a `Connection restored`
log message, even if this is the first connection from
this client.

Suppress this log message for reverse import to avoid
this wrong logging.

Test-Parameters: trivial
Signed-off-by: Aurelien Degremont <degremoa@amazon.com>
Change-Id: I6f35b8d916a4ae535d55ba39b491f57e1553986c
Reviewed-on: https://review.whamcloud.com/40331
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ptlrpc/import.c

index 60c6e29..845846e 100644 (file)
@@ -1643,12 +1643,16 @@ int ptlrpc_import_recovery_state_machine(struct obd_import *imp)
                        GOTO(out, rc);
                ptlrpc_activate_import(imp, true);
 
-               CDEBUG_LIMIT(imp->imp_was_idle ?
-                               imp->imp_idle_debug : D_CONSOLE,
-                            "%s: Connection restored to %s (at %s)\n",
-                            imp->imp_obd->obd_name,
-                            obd_uuid2str(&conn->c_remote_uuid),
-                            obd_import_nid2str(imp));
+               /* Reverse import are flagged with dlm_fake == 1.
+                * They do not do recovery and connection are not "restored".
+                */
+               if (!imp->imp_dlm_fake)
+                       CDEBUG_LIMIT(imp->imp_was_idle ?
+                                       imp->imp_idle_debug : D_CONSOLE,
+                                    "%s: Connection restored to %s (at %s)\n",
+                                    imp->imp_obd->obd_name,
+                                    obd_uuid2str(&conn->c_remote_uuid),
+                                    obd_import_nid2str(imp));
                spin_lock(&imp->imp_lock);
                imp->imp_was_idle = 0;
                spin_unlock(&imp->imp_lock);