|
|
|
@ -98,17 +98,20 @@ class L3AgentSchedulerDbMixin(l3agentscheduler.L3AgentSchedulerPluginBase,
|
|
|
|
|
cutoff = self.get_cutoff_time(agent_dead_limit)
|
|
|
|
|
|
|
|
|
|
context = n_ctx.get_admin_context()
|
|
|
|
|
down_bindings = (
|
|
|
|
|
context.session.query(RouterL3AgentBinding).
|
|
|
|
|
join(agents_db.Agent).
|
|
|
|
|
filter(agents_db.Agent.heartbeat_timestamp < cutoff,
|
|
|
|
|
agents_db.Agent.admin_state_up).
|
|
|
|
|
outerjoin(l3_attrs_db.RouterExtraAttributes,
|
|
|
|
|
l3_attrs_db.RouterExtraAttributes.router_id ==
|
|
|
|
|
RouterL3AgentBinding.router_id).
|
|
|
|
|
filter(sa.or_(l3_attrs_db.RouterExtraAttributes.ha == sql.false(),
|
|
|
|
|
l3_attrs_db.RouterExtraAttributes.ha == sql.null())))
|
|
|
|
|
try:
|
|
|
|
|
down_bindings = (
|
|
|
|
|
context.session.query(RouterL3AgentBinding).
|
|
|
|
|
join(agents_db.Agent).
|
|
|
|
|
filter(agents_db.Agent.heartbeat_timestamp < cutoff,
|
|
|
|
|
agents_db.Agent.admin_state_up).
|
|
|
|
|
outerjoin(l3_attrs_db.RouterExtraAttributes,
|
|
|
|
|
l3_attrs_db.RouterExtraAttributes.router_id ==
|
|
|
|
|
RouterL3AgentBinding.router_id).
|
|
|
|
|
filter(sa.or_(l3_attrs_db.RouterExtraAttributes.ha ==
|
|
|
|
|
sql.false(),
|
|
|
|
|
l3_attrs_db.RouterExtraAttributes.ha ==
|
|
|
|
|
sql.null())))
|
|
|
|
|
|
|
|
|
|
agents_back_online = set()
|
|
|
|
|
for binding in down_bindings:
|
|
|
|
|
if binding.l3_agent_id in agents_back_online:
|
|
|
|
|