| 44 | } |
| 45 | |
| 46 | int EventMonitor::CheckRunningStatus() { |
| 47 | int ret = OK; |
| 48 | vector < string > gtid_list; |
| 49 | if (option_->GetBinLogSvrConfig()->IsForceMakingCheckPoint()) { |
| 50 | ret = MasterMonitor::GetMySQLMaxGTIDList(option_, >id_list,master_manager_->IsMaster()); |
| 51 | } else { |
| 52 | vector < string > member_iplist; |
| 53 | master_manager_->GetMemberIPList(&member_iplist); |
| 54 | |
| 55 | ret = MasterMonitor::GetGlobalMySQLMaxGTIDList(option_, member_iplist, >id_list); |
| 56 | } |
| 57 | |
| 58 | LogVerbose("%s get gtid list ret %d", __func__, ret); |
| 59 | if (ret == OK) { |
| 60 | ret = storage_manager_->MakeCheckPoint(gtid_list); |
| 61 | |
| 62 | uint64_t max_instanceid = 0; |
| 63 | EventStorage *event_storage = storage_manager_->GetEventStorage(); |
| 64 | for (const auto >id : gtid_list) { |
| 65 | EventDataInfo data_info; |
| 66 | int ret = event_storage->GetGTIDInfo(gtid, &data_info, true); |
| 67 | if (ret) { |
| 68 | continue; |
| 69 | } |
| 70 | max_instanceid = std::max(max_instanceid, (uint64_t) data_info.instance_id()); |
| 71 | } |
| 72 | |
| 73 | uint64_t storage_instanceid = event_storage->GetLastInstanceID(); |
| 74 | ColorLogInfo("%s current mysql instanceid %lu, binlog svr instanceid %lu", __func__, max_instanceid, |
| 75 | storage_instanceid); |
| 76 | |
| 77 | if (max_instanceid && max_instanceid <= storage_instanceid) { |
| 78 | STATISTICS(MySqlGtidNumDiff(storage_instanceid - max_instanceid)); |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | return ret; |
| 83 | } |
| 84 | |
| 85 | int EventMonitor::Process() { |
| 86 | while (!stop_) { |
nothing calls this directly
no test coverage detected