Skip to content

Commit

Permalink
Revert "fix: master has db data, but no binlog. a new slave has repli…
Browse files Browse the repository at this point in the history
…cation_id in its config. this must execute full sync(#2436) (#2444)" (#2460)

This reverts commit ab9ed71.

Co-authored-by: liuchengyu <liuchengyu@360.cn>
  • Loading branch information
chengyu-l and liuchengyu authored Mar 7, 2024
1 parent a753d90 commit 4d0cfaf
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/pika_repl_server_conn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,6 @@ bool PikaReplServerConn::TrySyncOffsetCheck(const std::shared_ptr<SyncMasterDB>&
return false;
}

if (boffset.filenum == slave_boffset.filenum() && slave_boffset.filenum() == 0 &&
boffset.offset == slave_boffset.offset() && slave_boffset.offset() == 0) {
LOG(INFO) << "maybe a new master and slave, there is no binlog, but has db data, this need full sync";
try_sync_response->set_reply_code(InnerMessage::InnerResponse::TrySync::kSyncPointBePurged);
return false;
}

PikaBinlogReader reader;
reader.Seek(db->Logger(), slave_boffset.filenum(), slave_boffset.offset());
BinlogOffset seeked_offset;
Expand Down

0 comments on commit 4d0cfaf

Please sign in to comment.