Skip to content

Commit

Permalink
loose AccessHandle of BinlogReceiver
Browse files Browse the repository at this point in the history
  • Loading branch information
KernelMaker committed Aug 17, 2017
1 parent 80e1bcf commit a9856c7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/pika_binlog_receiver_thread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ bool PikaBinlogReceiverThread::Handles::AccessHandle(std::string& ip) const {
if (ip == "127.0.0.1") {
ip = g_pika_server->host();
}
if (binlog_receiver_->thread_rep_->conn_num() != 0 ||
!g_pika_server->ShouldAccessConnAsMaster(ip)) {
// if (binlog_receiver_->thread_rep_->conn_num() != 0 ||
if (!g_pika_server->ShouldAccessConnAsMaster(ip)) {
LOG(WARNING) << "BinlogReceiverThread AccessHandle failed: " << ip;
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions src/pika_binlog_sender_thread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ void* PikaBinlogSenderThread::ThreadMain() {

while (!should_stop()) {

sleep(1);
sleep(2);
// 1. Connect to slave
result = cli_->Connect(ip_, port_, g_pika_server->host());
LOG(INFO) << "BinlogSender Connect slave(" << ip_ << ":" << port_ << ") " << result.ToString();
Expand Down Expand Up @@ -281,7 +281,7 @@ void* PikaBinlogSenderThread::ThreadMain() {
last_send_flag = true;
} else {
last_send_flag = false;
DLOG(INFO) << "BinlogSender send slave(" << ip_ << ":" << port_ << ") failed, " << result.ToString();
LOG(WARNING) << "BinlogSender send slave(" << ip_ << ":" << port_ << ") failed, " << result.ToString();
//close(sockfd_);
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/pika_slaveping_thread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ void* PikaSlavepingThread::ThreadMain() {
}
sleep(1);
}
sleep(2);
g_pika_server->MinusMasterConnection();
sleep(2);
} else if (!should_stop()) {
LOG(WARNING) << "Slaveping, Connect timeout";
if ((++connect_retry_times) >= 30) {
Expand Down

0 comments on commit a9856c7

Please sign in to comment.