Comment 3 for bug 1499647

Revision history for this message
Ann Taraday (akamyshnikova) wrote : Re: L3 HA: extra L3HARouterAgentPortBinding created for routers

@Assaf Muller

Thanks a lot for your research! It helped me a lot with debugging.

About your suggestion:

I see that there is 2 problems when there is extra L3HARouterAgentPortBinding with l3_agent_id=None and when there is duplication with l3_agent_id.

When I checked more I realize that _create_ha_port_binding https://github.com/openstack/neutron/blob/master/neutron/db/l3_hamode_db.py#L304 creates L3HARouterAgentPortBinding with l3_agent_id=None http://paste.openstack.org/show/474814/, so UniqueConstraint won't help here. The only way to prevent this error is to check that number of already created ha port bindings for router is less than max_l3_agents_per_router. This should solution for the first problem,but for resolving the second one we will need to add UniqueConstraint to prevent updating L3HARouterAgentPortBinding with duplicate.