Skip to content

Commit

Permalink
fix not syncing (#2430)
Browse files Browse the repository at this point in the history
Co-authored-by: 白鑫 <baixin@MacBook-Air.local>
  • Loading branch information
baixin01 and 白鑫 authored Mar 3, 2024
1 parent 60718b1 commit ca69573
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pika_repl_client_thread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ void PikaReplClientThread::ReplClientHandle::FdTimeoutHandle(int fd, const std::
}
if (ip == g_pika_server->master_ip() && port == g_pika_server->master_port() + kPortShiftReplServer &&
PIKA_REPL_ERROR != g_pika_server->repl_state() &&
PikaReplicaManager::CheckSlaveDBState(ip, port)) { // if state machine in error state, no retry
PikaReplicaManager::CheckSlaveDBState(ip, port)) {
// if state machine equal to kDBNoConnect(execute cmd 'dbslaveof db no one'), no retry
LOG(WARNING) << "Master conn timeout : " << ip_port << " try reconnect";
g_pika_server->ResetMetaSyncStatus();
}
Expand Down
2 changes: 2 additions & 0 deletions src/pika_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@ int32_t PikaServer::GetSlaveListString(std::string& slave_list_str) {
master_boffset.offset - sent_slave_boffset.offset;
tmp_stream << "(" << db->DBName() << ":" << lag << ")";
}
} else if (s.ok() && slave_state == SlaveState::kSlaveDbSync){
tmp_stream << "(" << db->DBName() << ":full syncing)";
} else {
tmp_stream << "(" << db->DBName() << ":not syncing)";
}
Expand Down

0 comments on commit ca69573

Please sign in to comment.