From 730a84af92a4105f7f80b21b1b0de282aa0f4f59 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 2 Feb 2022 11:26:36 -0800 Subject: [PATCH] Silence resent log merge commit error The server's log merge complete request handler was considering the absence of the client's original request as a failure. Unfortunately, this case is possible if a previous server successfully completed the client's request but the response was lost because it stopped for whatever reason. The failure was being logged as a hard error to the console which was causing tests to occasionally fail during server failover that hit just as the log merge completion was being processed. The error was being sent to the client as a response, we just need to silence the message for these expected but rare errors. We also fix the related case where the server printed the even more harsh WARN_ON if there was a next original request but it wasn't the one we expected to find from our requesting client. Signed-off-by: Zach Brown --- kmod/src/server.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/kmod/src/server.c b/kmod/src/server.c index 24401a53..2b8221d7 100644 --- a/kmod/src/server.c +++ b/kmod/src/server.c @@ -2455,15 +2455,14 @@ static int server_commit_log_merge(struct super_block *sb, } /* find the completion's original saved request */ - ret = next_log_merge_item(sb, &super->log_merge, - SCOUTFS_LOG_MERGE_REQUEST_ZONE, - rid, le64_to_cpu(comp->seq), - &orig_req, sizeof(orig_req)); - if (WARN_ON_ONCE(ret == 0 && (comp->rid != orig_req.rid || - comp->seq != orig_req.seq))) - ret = -ENOENT; /* inconsistency */ + ret = next_log_merge_item(sb, &super->log_merge, SCOUTFS_LOG_MERGE_REQUEST_ZONE, + rid, le64_to_cpu(comp->seq), &orig_req, sizeof(orig_req)); + if (ret == 0 && (comp->rid != orig_req.rid || comp->seq != orig_req.seq)) + ret = -ENOENT; if (ret < 0) { - err_str = "finding orig request"; + /* ENOENT is expected for resent processed completion */ + if (ret != -ENOENT) + err_str = "finding orig request"; goto out; } @@ -2533,7 +2532,7 @@ static int server_commit_log_merge(struct super_block *sb, out: mutex_unlock(&server->logs_mutex); - if (ret < 0) + if (ret < 0 && err_str) scoutfs_err(sb, "error %d committing log merge: %s", ret, err_str); err = scoutfs_server_apply_commit(sb, ret);