| 323 | } |
| 324 | |
| 325 | int AgentMonitor::CheckMasterTimeOut() { |
| 326 | bool is_master = master_manager_->CheckMasterBySvrID(option_->GetBinLogSvrConfig()->GetEngineSvrID()); |
| 327 | int ret = OK; |
| 328 | if(!is_master) { |
| 329 | ret=IsGTIDCompleted(option_, event_manager_); |
| 330 | if (ret < 0) { |
| 331 | return ret; |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | if (!AgentExternalMonitor::IsHealthy()) { |
| 336 | ColorLogWarning("%s external monitor not healthy", __func__); |
| 337 | return SVR_FAIL; |
| 338 | } |
| 339 | |
| 340 | if (ret == OK) { |
| 341 | int ret = master_agent_->SetMaster(option_->GetBinLogSvrConfig()->GetEngineIP()); |
| 342 | if (ret == MASTER_CONFLICT) { |
| 343 | LogVerbose("%s master info does not timeout, skip", __func__); |
| 344 | } else { |
| 345 | LogVerbose("%s set new master info, ret %d", __func__, ret); |
| 346 | } |
| 347 | return OK; |
| 348 | } else { |
| 349 | ColorLogInfo("%s master info not complated, skip, just check slave status", __func__); |
| 350 | return CheckSlaveRunningStatus(); |
| 351 | } |
| 352 | return ret; |
| 353 | } |
| 354 | |
| 355 | int AgentMonitor::CheckSlaveRunningStatus() { |
| 356 | if (IsSlaveReady()) { |
nothing calls this directly
no test coverage detected