mirror of
https://github.com/versity/scoutfs.git
synced 2026-09-03 14:47:07 +00:00
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 <zab@versity.com>
This commit is contained in:
+8
-9
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user