Skip to content

Commit 4c6457e

Browse files
authored
[SmartSwitch-HA] Set pending flags back to false. (#3997)
What I did Set flow_reconcile_pending, activate_role_pending, and brainsplit_recover_pending back to false after receiving the appropriate notification. For flow_reconcile_pending and activate_role_pending, this is after controller sends operation approval. For brainsplit, clearing the flag after DPU enters stable state again. Why I did it flow_reconcile_pending, activate_role_pending, and brainsplit_recover_pending were not being reset to false after being set true for the first time.
1 parent 2ed250d commit 4c6457e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

orchagent/dash/dashhaorch.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,9 @@ bool DashHaOrch::setHaScopeFlowReconcileRequest(const std::string &key)
651651
}
652652
SWSS_LOG_NOTICE("Set HA Scope flow reconcile request for %s", key.c_str());
653653

654+
std::vector<FieldValueTuple> fvs = {{"flow_reconcile_pending", "false"}};
655+
m_dpuStateDbHaScopeTable->set(key, fvs);
656+
654657
return true;
655658
}
656659

@@ -678,6 +681,9 @@ bool DashHaOrch::setHaScopeActivateRoleRequest(const std::string &key)
678681
}
679682
SWSS_LOG_NOTICE("Set HA Scope activate role request for %s", key.c_str());
680683

684+
std::vector<FieldValueTuple> fvs = {{"activate_role_pending", "false"}};
685+
m_dpuStateDbHaScopeTable->set(key, fvs);
686+
681687
return true;
682688
}
683689

@@ -1026,6 +1032,11 @@ void DashHaOrch::doTask(NotificationConsumer &consumer)
10261032
fvs.push_back({"activate_role_pending", "true"});
10271033
SWSS_LOG_NOTICE("DPU is pending on role activation for %s", key.c_str());
10281034
}
1035+
else if (in(ha_scope_event[i].ha_state, {SAI_DASH_HA_STATE_ACTIVE,
1036+
SAI_DASH_HA_STATE_STANDBY}))
1037+
{
1038+
fvs.push_back({"brainsplit_recover_pending", "false"});
1039+
}
10291040

10301041
fvs.push_back({"ha_state", sai_ha_state_name.at(ha_scope_event[i].ha_state)});
10311042
fvs.push_back({"ha_state_start_time", to_string(now_time)});

0 commit comments

Comments
 (0)