Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replication: fix misleading log message about full sync #1717

Merged
merged 1 commit into from
Aug 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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