Skip to content

Commit 969133b

Browse files
authored
replication: fix misleading log message about full sync (#1717)
1 parent ac79167 commit 969133b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/server/replica.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,6 @@ error_code Replica::InitiatePSync() {
337337

338338
RETURN_ON_ERR(SendCommand(StrCat("PSYNC ", id, " ", offs)));
339339

340-
LOG(INFO) << "Starting full sync";
341-
342340
// Master may delay sync response with "repl_diskless_sync_delay"
343341
PSyncResponse repl_header;
344342

@@ -353,8 +351,9 @@ error_code Replica::InitiatePSync() {
353351

354352
// we get token for diskless redis replication. For disk based replication
355353
// we get the snapshot size.
356-
if (snapshot_size || token != nullptr) { // full sync
357-
// Start full sync
354+
if (snapshot_size || token != nullptr) {
355+
LOG(INFO) << "Starting full sync with Redis master";
356+
358357
state_mask_.fetch_or(R_SYNCING);
359358

360359
io::PrefixSource ps{io_buf.InputBuffer(), Sock()};
@@ -394,6 +393,8 @@ error_code Replica::InitiatePSync() {
394393
CHECK(ps.UnusedPrefix().empty());
395394
io_buf.ConsumeInput(io_buf.InputLen());
396395
TouchIoTime();
396+
} else {
397+
LOG(INFO) << "Re-established sync with Redis master with ID=" << id;
397398
}
398399

399400
state_mask_.fetch_and(~R_SYNCING);

0 commit comments

Comments
 (0)