Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix-for(E2E controller ignition over 1-hop RF sync link) #51

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions src/terragraph-e2e/e2e/controller/IgnitionApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ IgnitionApp::processLinkUpReq(
}

// check that the initiator is properly time-synced (i.e. GPS is enabled)
if (initiatorNode.status != thrift::NodeStatusType::ONLINE_INITIATOR) {
if (initiatorNode.status == thrift::NodeStatusType::OFFLINE) {
std::string initiatorStatus = folly::get_default(
TEnumMapFactory<thrift::NodeStatusType>::makeValuesToNamesMap(),
initiatorNode.status,
Expand All @@ -683,7 +683,25 @@ IgnitionApp::processLinkUpReq(
"Initiator node is not qualified, current state: {}.",
initiatorStatus));
return;
}
} else if (initiatorNode.status == thrift::NodeStatusType::ONLINE_INITIATOR) {
auto dnLinks = SharedObjects::getTopologyWrapper()->rlock()
->getLinksByNodeName(initiatorNode.name);
for (const auto& dnLink : dnLinks) {
if (dnLink.link_type != thrift::LinkType::WIRELESS) {

continue;
}
if (!dnLink.is_alive) {
LOG(ERROR) << "Received initiator DN is not alive."
<< initiatorNode.name << "Initiator node is not alive."
"Not alive: " << dnLink.name;
sendE2EAck(
senderApp, false,
"Initiator node is not alive, current state: {}.");
return;
}
}
}

// prevent igniting multiple links to the same CN
if (responderNode.node_type == thrift::NodeType::CN) {
Expand Down
2 changes: 1 addition & 1 deletion src/terragraph-e2e/e2e/if/NodeConfig.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ struct NodeEnvParams {
}

struct PopConfigParams {
1: optional string POP_ADDR;
1: string POP_ADDR;
2: optional string POP_IFACE;
3: optional string POP_STATIC_ROUTING;
4: optional string POP_BGP_ROUTING;
Expand Down
13 changes: 13 additions & 0 deletions src/terragraph-e2e/e2e/minion/StatusApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,19 @@ StatusApp::processFwAck(
newStatus = thrift::NodeStatusType::ONLINE;
}

LOG(ERROR) << drMessage->macPrefix() << "GPS is not in sync.";
eventClient_->logEventDynamic(
thrift::EventCategory::STATUS,
thrift::EventId::GPS_SYNC,
thrift::EventLevel::ERROR,
folly::sformat("GPS is not in sync ({})", drMessage->radioMac),
folly::dynamic::object("sync", false)("mac", drMessage->radioMac),
std::make_optional(drMessage->radioMac));
} else if (SharedObjects::getNodeConfigWrapper()->rlock()
->getNodeConfig()->popParams.POP_ADDR.empty()) {
newStatus = thrift::NodeStatusType::ONLINE;
radioStatus_[drMessage->radioMac].gpsSync = false;

LOG(ERROR) << drMessage->macPrefix() << "GPS is not in sync.";
eventClient_->logEventDynamic(
thrift::EventCategory::STATUS,
Expand Down