Fix issue with list/map property delete

Bug #1700855 reported by Ananth Suryanarayana
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R4.0
Fix Committed
High
Pramodh D'Souza
Trunk
Fix Committed
High
Pramodh D'Souza

Bug Description

Fix delete issue with list/map properties when timestamps are used.
Also, currently, none of the UTs in control-node/ifmap module tests map/list updates in configuration, so add UT.

Nischal Sheth (nsheth)
Changed in juniperopenstack:
importance: Undecided → Medium
description: updated
summary: - add unit tests for ifmap propm and propl parsing code
+ Fix issue with list/map property delete
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/33545
Submitter: Pramodh D'Souza (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R4.0

Review in progress for https://review.opencontrail.org/33577
Submitter: Pramodh D'Souza (<email address hidden>)

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

Reviewed: https://review.opencontrail.org/33545
Committed: http://github.com/Juniper/contrail-controller/commit/42ae97be25534796a78c57b7b18bacba623f639b
Submitter: Zuul (<email address hidden>)
Branch: master

commit 42ae97be25534796a78c57b7b18bacba623f639b
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

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

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

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.