| 7667 | } |
| 7668 | |
| 7669 | int NameServerImpl::UpdateEndpointTableAlive(const std::string& endpoint, bool is_alive) { |
| 7670 | if (!running_.load(std::memory_order_acquire)) { |
| 7671 | PDLOG(WARNING, "cur nameserver is not leader"); |
| 7672 | return 0; |
| 7673 | } |
| 7674 | std::lock_guard<std::mutex> lock(mu_); |
| 7675 | int ret = UpdateEndpointTableAliveHandle(endpoint, table_info_, is_alive); |
| 7676 | if (ret != 0) { |
| 7677 | return ret; |
| 7678 | } |
| 7679 | for (auto& kv : db_table_info_) { |
| 7680 | ret = UpdateEndpointTableAliveHandle(endpoint, kv.second, is_alive); |
| 7681 | if (ret != 0) { |
| 7682 | return ret; |
| 7683 | } |
| 7684 | } |
| 7685 | NotifyTableChanged(); |
| 7686 | return 0; |
| 7687 | } |
| 7688 | |
| 7689 | std::shared_ptr<Task> NameServerImpl::CreateSelectLeaderTask(uint64_t op_index, ::fedb::api::OPType op_type, |
| 7690 | const std::string& name, const std::string& db, |
nothing calls this directly
no outgoing calls
no test coverage detected