[Mainline/Mitaka] Objects inconsistent between reads while trying to validate RI

Bug #1716573 reported by Suresh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R4.0
Fix Committed
Critical
Suresh Vinapamula
Trunk
Fix Committed
Critical
Suresh Vinapamula

Bug Description

In the latest CB mainline build 44, Objects inconsistent between reads while trying to validate RI.

   During a intf mirroring test, the script validates that a RI in contrail-api has a reference to two other RIs. The query is done via the LB IP

    Across multiple runs, sometimes, it is seen that routing_instance_read() returns an object which does not have routing_instance_refs populated.

   When we debugged further, it is seen that the same query, when run 3 times, does not return the same output. For instance below, every 3rd RI read returns wrongly. Probably, one of the api-servers is returning wrongly.

  Observation has been that if we check the object using contrail-ui on all the 3 config nodes, the RI refs would have got populated and the query in the script too starts passing.

  Checked Cassandra contents on all the 3 nodes and could see RI refs for this object on all 3 cassandras. But the reads in the test script continues to fail.

(Pdb) print vars(self.connections.vnc_lib_fixture.routing_instance_read(fq_name=ri_fq_name)) <<<< no routing_instance_refs
{'_type': 'routing-instance', '_static_route_entries': route = [], 'fq_name': [u'default-domain', u'ctest-TestIntfMirror-65639139', u'ctest-vn1-45608846', u'ctest-vn1-45608846'], 'name': u'ctest-vn1-45608846', '_pending_field_updates': set([]), '_routing_instance_has_pnf': False, '_uuid': u'00acbca6-2084-4931-b0bb-5b3041e5608f', 'parent_type': u'virtual-network', '_pending_ref_updates': set([]), '_pending_field_map_updates': {}, '_id_perms': permissions = owner = contrail-api, owner_access = 7, group = admin, group_access = 7, other_access = 7, uuid = uuid_mslong = 48621117690366257, uuid_lslong = 12734872634142318735, enable = True, created = 2017-09-11T19:32:36.163293, last_modified = 2017-09-11T19:32:36.235709, description = None, user_visible = True, creator = None, '_perms2': owner = 1b8813c441f24c94aa06086a265a9837, owner_access = 7, global_access = 0, share = [], 'route_target_refs': [{u'to': [u'target:64510:8000009'], u'href': u'http://10.204.216.160:8082/route-target/ed8c55b7-5b5b-4955-9c34-7e3696610e15', u'attr': import_export = None, u'uuid': u'ed8c55b7-5b5b-4955-9c34-7e3696610e15'}], '_pending_field_list_updates': {}, '_display_name': u'ctest-vn1-45608846', '_server_conn': <vnc_api.vnc_api.VncApi object at 0x7fec842dedd0>, '_routing_instance_is_default': True, 'parent_uuid': u'0e315c3e-ed30-465a-afb2-058c51dbe1c6'}
(Pdb) print vars(self.connections.vnc_lib_fixture.routing_instance_read(fq_name=ri_fq_name))
{'_type': 'routing-instance', '_static_route_entries': route = [], 'fq_name': [u'default-domain', u'ctest-TestIntfMirror-65639139', u'ctest-vn1-45608846', u'ctest-vn1-45608846'], 'name': u'ctest-vn1-45608846', '_pending_field_updates': set([]), '_routing_instance_has_pnf': False, '_uuid': u'00acbca6-2084-4931-b0bb-5b3041e5608f', 'parent_type': u'virtual-network', '_pending_ref_updates': set([]), '_pending_field_map_updates': {}, '_id_perms': permissions = owner = contrail-api, owner_access = 7, group = admin, group_access = 7, other_access = 7, uuid = uuid_mslong = 48621117690366257, uuid_lslong = 12734872634142318735, enable = True, created = 2017-09-11T19:32:36.163293, last_modified = 2017-09-11T19:32:36.235709, description = None, user_visible = True, creator = None, '_perms2': owner = 1b8813c441f24c94aa06086a265a9837, owner_access = 7, global_access = 0, share = [], 'route_target_refs': [{u'to': [u'target:64510:8000009'], u'href': u'http://10.204.216.160:8082/route-target/ed8c55b7-5b5b-4955-9c34-7e3696610e15', u'attr': import_export = None, u'uuid': u'ed8c55b7-5b5b-4955-9c34-7e3696610e15'}], '_pending_field_list_updates': {}, 'routing_instance_refs': [{u'to': [u'default-domain', u'ctest-TestIntfMirror-65639139', u'ctest-vn3-78087498', u'ctest-vn3-78087498'], u'href': u'http://10.204.216.160:8082/routing-instance/8b713aa6-c79d-4e5a-858a-1b5dac77c221', u'attr': destination_instance = None, u'uuid': u'8b713aa6-c79d-4e5a-858a-1b5dac77c221'}, {u'to': [u'default-domain', u'ctest-TestIntfMirror-65639139', u'ctest-vn2-61893951', u'ctest-vn2-61893951'], u'href': u'http://10.204.216.160:8082/routing-instance/e1d236b0-0589-41e2-88bc-2823c61acf53', u'attr': destination_instance = None, u'uuid': u'e1d236b0-0589-41e2-88bc-2823c61acf53'}], '_display_name': u'ctest-vn1-45608846', '_server_conn': <vnc_api.vnc_api.VncApi object at 0x7fec842dedd0>, '_routing_instance_is_default': True, 'parent_uuid': u'0e315c3e-ed30-465a-afb2-058c51dbe1c6'}
(Pdb) print vars(self.connections.vnc_lib_fixture.routing_instance_read(fq_name=ri_fq_name))
{'_type': 'routing-instance', '_static_route_entries': route = [], 'fq_name': [u'default-domain', u'ctest-TestIntfMirror-65639139', u'ctest-vn1-45608846', u'ctest-vn1-45608846'], 'name': u'ctest-vn1-45608846', '_pending_field_updates': set([]), '_routing_instance_has_pnf': False, '_uuid': u'00acbca6-2084-4931-b0bb-5b3041e5608f', 'parent_type': u'virtual-network', '_pending_ref_updates': set([]), '_pending_field_map_updates': {}, '_id_perms': permissions = owner = contrail-api, owner_access = 7, group = admin, group_access = 7, other_access = 7, uuid = uuid_mslong = 48621117690366257, uuid_lslong = 12734872634142318735, enable = True, created = 2017-09-11T19:32:36.163293, last_modified = 2017-09-11T19:32:36.235709, description = None, user_visible = True, creator = None, '_perms2': owner = 1b8813c441f24c94aa06086a265a9837, owner_access = 7, global_access = 0, share = [], 'route_target_refs': [{u'to': [u'target:64510:8000009'], u'href': u'http://10.204.216.160:8082/route-target/ed8c55b7-5b5b-4955-9c34-7e3696610e15', u'attr': import_export = None, u'uuid': u'ed8c55b7-5b5b-4955-9c34-7e3696610e15'}], '_pending_field_list_updates': {}, 'routing_instance_refs': [{u'to': [u'default-domain', u'ctest-TestIntfMirror-65639139', u'ctest-vn2-61893951', u'ctest-vn2-61893951'], u'href': u'http://10.204.216.160:8082/routing-instance/e1d236b0-0589-41e2-88bc-2823c61acf53', u'attr': destination_instance = None, u'uuid': u'e1d236b0-0589-41e2-88bc-2823c61acf53'}, {u'to': [u'default-domain', u'ctest-TestIntfMirror-65639139', u'ctest-vn3-78087498', u'ctest-vn3-78087498'], u'href': u'http://10.204.216.160:8082/routing-instance/8b713aa6-c79d-4e5a-858a-1b5dac77c221', u'attr': destination_instance = None, u'uuid': u'8b713aa6-c79d-4e5a-858a-1b5dac77c221'}], '_display_name': u'ctest-vn1-45608846', '_server_conn': <vnc_api.vnc_api.VncApi object at 0x7fec842dedd0>, '_routing_instance_is_default': True, 'parent_uuid': u'0e315c3e-ed30-465a-afb2-058c51dbe1c6'}
(Pdb) print ri_fq_name
['default-domain', 'ctest-TestIntfMirror-65639139', 'ctest-vn1-45608846', 'ctest-vn1-45608846']
(Pdb)

Testcase name:
==============
TestIntfMirror.test_intf_mirror_with_subintf_src_cn1vn1_dst_cn2vn2_analyzer_cn3vn3

Reference to running a testcase - https://github.com/Juniper/contrail-test-ci/wiki/How-to-use-contrail-test-ci-container

steps to repro:
===============
The issue is seen while trying to validate RI reference when running the above testcase.
So i added a pdb in validate_vn function in /contrail-test/common/servicechain/verify.py and started the script.
It checks for ri_obj for first time and if its present, scripts continues. If ri_obj is not there, then it goes into a loop and keeps checking for 15 times with delay of 5 secs.
Since i have put pdb, it will check for ri_obj once and if it is not present, script will pause and we can debug the issue.

Suresh (suresha)
Changed in juniperopenstack:
milestone: none → r4.1.0.0-fcs
description: updated
tags: added: sanityblocker
removed: sanity
Suresh (suresha)
description: updated
Suresh (suresha)
description: updated
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/35598
Submitter: Suresh Vinapamula (<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/35618
Submitter: Suresh Vinapamula (<email address hidden>)

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

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

commit 061e29144039203fbddb526df962c7dcc936baa2
Author: Suresh Venkata <email address hidden>
Date: Wed Sep 13 15:52:30 2017 -0700

Sanity bug fixes in cassandra cache and keystone authentication

Description: This commit has two fixes.

1) For calls made through api-lib, exclude_back_refs is true,
id_perms timestamp is used to cassandra cache has to be refresshed.
update_latest_col_ts doesn't update id_perms timestamp, when
symmetric refs are updated. Changed to call update_last_modified
does update id_perms timestamp as well as latest_col_ts.

2) keystone authentication when failed in neutron plugin code,
will return empty auth_hdrs. Because empty auth_hdrs are returned,
HTTP_X_ROLES were missing when the execution comes to RBAC.
When authentiation fails, auth headers are set to None, and this
will raise AuthFailed exception in plugin code, which client may
use to retry with a valid token.

Change-Id: I46827370bba90bbad1b36843474f636e3cf72f77
Closes-Bug: #1716311
Closes-Bug: #1716573

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

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

commit 9b9a146d24e664917fdeb5dbb80f8c685f0ca4bd
Author: Suresh Venkata <email address hidden>
Date: Wed Sep 13 15:52:30 2017 -0700

Sanity bug fixes in cassandra cache and keystone authentication

Description: This commit has two fixes.

1) For calls made through api-lib, exclude_back_refs is true,
id_perms timestamp is used to cassandra cache has to be refresshed.
update_latest_col_ts doesn't update id_perms timestamp, when
symmetric refs are updated. Changed to call update_last_modified
does update id_perms timestamp as well as latest_col_ts.

2) keystone authentication when failed in neutron plugin code,
will return empty auth_hdrs. Because empty auth_hdrs are returned,
HTTP_X_ROLES were missing when the execution comes to RBAC.
When authentiation fails, auth headers are set to None, and this
will raise AuthFailed exception in plugin code, which client may
use to retry with a valid token.

Change-Id: I46827370bba90bbad1b36843474f636e3cf72f77
Closes-Bug: #1716311
Closes-Bug: #1716573

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.