Skip to content

Commit

Permalink
replication: fix misleading log message about full sync (#1717)
Browse files Browse the repository at this point in the history
  • Loading branch information
royjacobson committed Aug 21, 2023
1 parent ac79167 commit 969133b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/server/replica.cc
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,6 @@ error_code Replica::InitiatePSync() {

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

LOG(INFO) << "Starting full sync";

// Master may delay sync response with "repl_diskless_sync_delay"
PSyncResponse repl_header;

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

// we get token for diskless redis replication. For disk based replication
// we get the snapshot size.
if (snapshot_size || token != nullptr) { // full sync
// Start full sync
if (snapshot_size || token != nullptr) {
LOG(INFO) << "Starting full sync with Redis master";

state_mask_.fetch_or(R_SYNCING);

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

state_mask_.fetch_and(~R_SYNCING);
Expand Down

0 comments on commit 969133b

Please sign in to comment.