Skip to content

Commit

Permalink
addbinlogsender: check both filenum and offset
Browse files Browse the repository at this point in the history
  • Loading branch information
KernelMaker committed May 31, 2016
1 parent 6e2a268 commit 21a889b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pika_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,8 @@ Status PikaServer::AddBinlogSender(SlaveItem &slave, uint32_t filenum, uint64_t
uint32_t cur_filenum = 0;
uint64_t cur_offset = 0;
logger_->GetProducerStatus(&cur_filenum, &cur_offset);
if (cur_filenum < filenum) {
return Status::InvalidArgument("AddBinlogSender invalid filenum");
if (cur_filenum < filenum || (cur_filenum == filenum && cur_offset < con_offset)) {
return Status::InvalidArgument("AddBinlogSender invalid binlog offset");
}

std::string slave_ip = slave.ip_port.substr(0, slave.ip_port.find(':'));
Expand Down

0 comments on commit 21a889b

Please sign in to comment.