~openstack/group-based-policy/master

Viewing all changes in revision 224.

  • Committer: Sumit Naiksatam
  • Author(s): Amit Bose
  • Date: 2015-10-12 22:11:13 UTC
  • Revision ID: git-v1:19ba4e8aa909f9f3b9b745f717dc761f8dc25068
Fix to DB update for auto-allocated external fixed IP

When testing with APIC mapping driver, when 2 L3-policies
are simulateously associated with the same 2 external-segments,
it is found that one of the updates fails with exception
IpAddressOverlappingInExternalSegment raised from
_set_ess_for_l3p(). The cause is a race between the two
operations, whereby a row of the form
<external-segment-id>, <l3policy-id>, ''
first gets inserted into table gp_es_to_l3p_associations,
and then gets updated to
<external-segment-id>, <l3policy-id>, <allocated-external-IP>
This transient row with empty-string as the allocated IP trips up
the check for IP-address being in use when there are
multiple L3-policies getting updated concurrently. The
empty string comes from the external-segment dict provided
in the API call.
This fix simply ignores the empty-string values.

Change-Id: Ifc25bcce4691f77ff16e18b9b4ea7baed198ea89
Signed-off-by: Amit Bose <amitbose@gmail.com>

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: