Comment 11 for bug 1700855

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/33577
Committed: http://github.com/Juniper/contrail-controller/commit/aaf429e1dc3cdaa9c86cffb4fa5555cbf9baccd4
Submitter: Zuul (<email address hidden>)
Branch: R4.0

commit aaf429e1dc3cdaa9c86cffb4fa5555cbf9baccd4
Author: Pramodh D'Souza <email address hidden>
Date: Mon Jul 10 22:56:13 2017 -0700

Fix issue with list/map property delete

This commit fixes an issue with deletes of list/map porperties.
The backend wasn't being updated when timestamps are used and one or
more key value pairs belonging to the same property are removed.
Note that for the issue occured if at least one key value pair remained
(with no timestamp change).
Added UT for list proerterites, map properties and a mix of list and
map proerties on the same object(vmi).
Notes on list map property processing:
Separate entries per list/map keys are stored in the ObjUuidCache
partition based on the uuid.
The cache map entries contain a refreshed bit and timestamp in addition
to the values etc.
A set containing list/map property names (updated_list_map_properties)
that have key/value pairs with a new timestamp, a second set
(candidate_list_map_properties) also containing list/map property names
that may require an update given some key/value pairs have been
deleted, and a multimap (list_map_properties) for all the list/map key
value pairs in the new configuration, are build and held in the
context(temporary).
These lists are used to determine which list/map properties need to be
pushed to the backend, they are built as columns are parsed. Once all
columns are parsed, in ListMapPropReviseUpdatelist, for each property
name in candidate_list_map_properties we check it is already in the
updated_list_map_property list, if not we proceed to find at least one
stale list/map key value pair with the property name in the
ObJUuidCache, if one is found that requires an update, the property
name is added to updated_list_map_properties.
Once updated_list_map_properties is revised, we iterate through each
property name in it and push all matching key/value pairs in
list_map_properties.
ConfigCass2JsonAdapter groups the key value pairs belonging to the same
property so that a single DB request is sent to the backend.
Deletes are handled by FormDeleteRequestList. Note that deletes are
sent only when all key/value pairs for a given list/map property are
removed.
Additionally, the resulting DB request only resets the property_set
bit, it does not clear the entries in the backend.

Change-Id: I13e626ea88cd61fe97ea8c4b72b4a2a1ec170ca5
Closes-Bug: #1700855