From 9454ec2c34f14c415e2f9aa62a1fc91087de60f5 Mon Sep 17 00:00:00 2001 From: naglera Date: Tue, 9 Apr 2024 15:09:00 +0000 Subject: [PATCH] fix comments --- src/networking.c | 9 +++++---- src/server.c | 2 +- src/server.h | 2 +- tests/integration/replication.tcl | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/networking.c b/src/networking.c index 6712d588dd..c5ea529cdd 100644 --- a/src/networking.c +++ b/src/networking.c @@ -1810,13 +1810,14 @@ int freeClientsInAsyncFreeQueue(void) { while ((ln = listNext(&li)) != NULL) { client *c = listNodeValue(ln); - if (c->flags & CLIENT_PROTECTED_RDB_CHANNEL) { /* Check if we can remove RDB connection protection. */ + if (c->flags & CLIENT_PROTECTED_RDB_CHANNEL) { + /* Check if we can remove RDB connection protection. */ if (!c->rdb_client_disconnect_time) { c->rdb_client_disconnect_time = server.unixtime; continue; } if (server.unixtime - c->rdb_client_disconnect_time > server.wait_before_rdb_client_free) { - serverLog(LL_NOTICE, "Replica main connection failed to establish PSYNC within the grace period. Freeing RDB client %lu.", c->id); + serverLog(LL_NOTICE, "Replica main connection failed to establish PSYNC within the grace period (%ld seconds). Freeing RDB client %llu.", (long int)(server.unixtime - c->rdb_client_disconnect_time), (unsigned long long)c->id); c->flags &= ~CLIENT_PROTECTED_RDB_CHANNEL; } } @@ -2736,7 +2737,7 @@ void readQueryFromClient(connection *conn) { sds info = catClientInfoString(sdsempty(), c); serverLog(LL_VERBOSE, "Client closed connection %s", info); if (c->flags & CLIENT_PROTECTED_RDB_CHANNEL) { - serverLog(LL_VERBOSE, "Postpone RDB client (%lu) free for %d seconds", c->id, server.wait_before_rdb_client_free); + serverLog(LL_VERBOSE, "Postpone RDB client (%llu) free for %d seconds", (unsigned long long)c->id, server.wait_before_rdb_client_free); } sdsfree(info); } @@ -2751,7 +2752,7 @@ void readQueryFromClient(connection *conn) { c->lastinteraction = server.unixtime; if (c->flags & CLIENT_MASTER) { c->read_reploff += nread; - atomicIncr(server.stat_total_reads_processed, nread); + atomicIncr(server.stat_net_repl_input_bytes, nread); } else { atomicIncr(server.stat_net_input_bytes, nread); } diff --git a/src/server.c b/src/server.c index db38f264da..143244f384 100644 --- a/src/server.c +++ b/src/server.c @@ -6024,7 +6024,7 @@ sds genRedisInfoString(dict *section_dict, int all_sections, int everything) { } } info = sdscatprintf(info, FMTARGS( - "slaves_waiting_psync:%llu\r\n", raxSize(server.slaves_waiting_psync), + "slaves_waiting_psync:%llu\r\n", (unsigned long long)raxSize(server.slaves_waiting_psync), "master_failover_state:%s\r\n", getFailoverStateString(), "master_replid:%s\r\n", server.replid, "master_replid2:%s\r\n", server.replid2, diff --git a/src/server.h b/src/server.h index 700c863dcf..3f4561df0a 100644 --- a/src/server.h +++ b/src/server.h @@ -1650,7 +1650,7 @@ struct valkeyServer { list *clients_pending_write; /* There is to write or install handler. */ list *clients_pending_read; /* Client has pending read socket buffers. */ list *slaves, *monitors; /* List of slaves and MONITORs */ - rax *slaves_waiting_psync; /* Radis tree using rdb-client id as keys and rdb-client as values. + rax *slaves_waiting_psync; /* Radix tree using rdb-client id as keys and rdb-client as values. * This rax contains slaves for the period from the beginning of * their RDB connection to the end of their main connection's * partial synchronization. */ diff --git a/tests/integration/replication.tcl b/tests/integration/replication.tcl index 6519cb6e78..cbc5fb4a29 100644 --- a/tests/integration/replication.tcl +++ b/tests/integration/replication.tcl @@ -2034,7 +2034,7 @@ start_server {tags {"repl rdb-channel external:skip"}} { } # Sync should fail once the replica ask for PSYNC using main channel - set res [wait_for_log_messages -1 {"*Replica main connection failed to establish PSYNC within the grace period*"} 0 2000 1] + set res [wait_for_log_messages -1 {"*Replica main connection failed to establish PSYNC within the grace period*"} 0 4000 1] # Should succeed on retry verify_replica_online $master 0 500