summaryrefslogtreecommitdiff
path: root/src/replication.c
diff options
context:
space:
mode:
authorBinbin <binloveplay1314@qq.com>2022-08-04 15:47:37 +0800
committerGitHub <noreply@github.com>2022-08-04 10:47:37 +0300
commit4505eb18213c8da31c6dd39ba7cd36d3d01141a5 (patch)
tree4cbf4047cac3d13ff1b17145fb358a7bc6627702 /src/replication.c
parent6686c6d774fcf71fffbaeff798c997ab3eff80de (diff)
downloadredis-4505eb18213c8da31c6dd39ba7cd36d3d01141a5.tar.gz
errno cleanup around rdbLoad (#11042)
This is an addition to #11039, which cleans up rdbLoad* related errno. Remove the errno print from the outer message (may be invalid since errno may have been overwritten). Our aim should be the code that detects the error and knows which system call triggered it, is the one to print errno, and not the code way up above (in some cases a result of a logical error and not a system one). Remove the code to update errno in rdbLoadRioWithLoadingCtx, signature check and the rdb version check, in these cases, we do print the error message. The caller dose not have the specific logic for handling EINVAL. Small fix around rdb-preamble AOF: A truncated RDB is considered a failure, not handled the same as a truncated AOF file.
Diffstat (limited to 'src/replication.c')
-rw-r--r--src/replication.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/replication.c b/src/replication.c
index 65ae27069..faf159d7d 100644
--- a/src/replication.c
+++ b/src/replication.c
@@ -2055,7 +2055,7 @@ void readSyncBulkPayload(connection *conn) {
/* RDB loading failed. */
serverLog(LL_WARNING,
"Failed trying to load the MASTER synchronization DB "
- "from socket: %s", strerror(errno));
+ "from socket, check server logs.");
loadingFailed = 1;
} else if (usemark) {
/* Verify the end mark is correct. */
@@ -2164,7 +2164,7 @@ void readSyncBulkPayload(connection *conn) {
if (rdbLoad(server.rdb_filename,&rsi,RDBFLAGS_REPLICATION) != RDB_OK) {
serverLog(LL_WARNING,
"Failed trying to load the MASTER synchronization "
- "DB from disk: %s", strerror(errno));
+ "DB from disk, check server logs.");
cancelReplicationHandshake(1);
if (server.rdb_del_sync_files && allPersistenceDisabled()) {
serverLog(LL_NOTICE,"Removing the RDB file obtained from "