flood-unknown-unicast flag not set in control-node or agent

Bug #1457327 reported by Vedamurthy Joshi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R2.20
Fix Committed
Critical
Tapan Karwa
Trunk
Fix Committed
Critical
Tapan Karwa

Bug Description

R2.20 Build 25 Ubuntu 14.04 Juno multi-node setup

On vn vn-02899298, we set the flood-unknown-unicast flag to true.
In config node, it is set correctly as True on the VN, but in control-node and agent, the flag is still false

http://nodec2:8083/Snh_SandeshTraceRequest?x=IFMapBigMsgTraceBuf shows True for this flag:

"2015-05-21 10:56:28.546 IFMapServerConnectionTrace: 0 bytes in reply_. 3428 bytes in reply_str. PollResponse message is: HTTP/1.1 200 Content-Type: application/soap+xml Content-Length: 3353 <?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns3:Envelope xmlns:ns2="http://www.trustedcomputinggroup.org/2010/IFMAP/2" xmlns:ns3="http://www.w3.org/2003/05/soap-envelope"><ns3:Body><ns2:response><pollResult><updateResult name="root"><resultItem><identity name="contrail:virtual-network:default-domain:TestTor-12621274:vn-02899298" type="other" other-type-definition="extended"/><identity name="contrail:network-ipam:default-domain:default-project:default-network-ipam" type="other" other-type-definition="extended"/><metadata><contrail:virtual-network-network-ipam xmlns:contrail="http://www.contrailsystems.com/vnc_cfg.xsd" ifmap-cardinality="singleValue" ifmap-publisher-id="api-server-1--0000000001-1" ifmap-timestamp="2015-05-21T10:56:28+05:30"><ipam-subnets><subnet><ip-prefix>49.52.230.0</ip-prefix><ip-prefix-len>24</ip-prefix-len> </subnet><default-gateway>49.52.230.1</default-gateway><dns-server-address>49.52.230.2</dns-server-address><subnet-uuid>07aabfb3-2b2b-4b4e-a498-b31454d54668</subnet-uuid><enable-dhcp>true</enable-dhcp><addr_from_start>true</addr_from_start><dhcp-option-list><dhcp-option><dhcp-option-name>6</dhcp-option-name><dhcp-option-value>0.0.0.0</dhcp-option-value> </dhcp-option> </dhcp-option-list><host-routes/></ipam-subnets></contrail:virtual-network-network-ipam></metadata></resultItem><resultItem><identity name="contrail:virtual-network:default-domain:TestTor-12621274:vn-02899298" type="other" other-type-definition="extended"/><metadata><contrail:flood-unknown-unicast xmlns:contrail="http://www.contrailsystems.com/vnc_cfg.xsd" ifmap-cardinality="singleValue" ifmap-publisher-id="api-server-1--0000000001-1" ifmap-timestamp="2015-05-21T10:56:28+05:30">True</contrail:flood-unknown-unicast></metadata></resultItem><resultItem><identity name="contrail:virtual-network:default-domain:TestTor-12621274:vn-02899298" type="other" other-type-definition="extended"/><identity name="contrail:network-policy:default-domain:TestTor-12621274:default-analyzer-ana1-policy" type="other" other-type-definition="extended"/><metadata><contrail:virtual-network-network-policy xmlns:contrail="http://www.contrailsystems.com/vnc_cfg.xsd" ifmap-cardinality="singleValue" ifmap-publisher-id="api-server-1--0000000001-1" ifmap-timestamp="2015-05-21T10:56:28+05:30"><sequence><major>0</major><minor>0</minor></sequence><timer><start-time/></timer></contrail:virtual-network-network-policy></metadata></resultItem><resultItem><identity name="contrail:virtual-network:default-domain:TestTor-12621274:vn-02899298" type="other" other-type-definition="extended"/><metadata><contrail:id-perms xmlns:contrail="http://www.contrailsystems.com/vnc_cfg.xsd" ifmap-cardinality="singleValue" ifmap-publisher-id="api-server-1--0000000001-1" ifmap-timestamp="2015-05-21T10:56:28+05:30"><permissions><owner>admin</owner><owner-access>7</owner-access><group>KeystoneAdmin</group><group-access>7</group-access><other-access>7</other-access></permissions><uuid><uuid-mslong>4711378623372806750</uuid-mslong><uuid-lslong>11190990926001937359</uuid-lslong></uuid><enable>true</enable><created>2015-05-21T03:19:59.739947</created><last-modified>2015-05-21T05:26:28.477746</last-modified><user-visible>true</user-visible></contrail:id-perms></metadata></resultItem></updateResult></pollResult></ns2:response></ns3:Body></ns3:Envelope> controller/src/ifmap/client/ifmap_channel.cc 585
"

In control-node ifmap db, it is false :

http://nodec1:8083/Snh_IFMapTableShowReq?table_name=&search_string=

"<iq>
 <virtual-network-properties>
  <allow-transit>false</allow-transit>
  <network-id>0</network-id>
  <vxlan-network-identifier>4</vxlan-network-identifier>
  <forwarding-mode>l2_l3</forwarding-mode>
  <rpf></rpf>
 </virtual-network-properties>
 <virtual-network-network-id>4</virtual-network-network-id>
 <route-target-list>
  <route-target>target:64512:5000</route-target>
 </route-target-list>
 <router-external>false</router-external>
 <is-shared>false</is-shared>
 <flood-unknown-unicast>false</flood-unknown-unicast>
 <id-perms>
  <permissions>
   <owner>admin</owner>
   <owner-access>7</owner-access>
   <group>KeystoneAdmin</group>
   <group-access>7</group-access>
   <other-access>7</other-access>
  </permissions>
  <uuid>
   <uuid-mslong>4711378623372806750</uuid-mslong>
   <uuid-lslong>11190990926001937359</uuid-lslong>
  </uuid>
  <enable>true</enable>
  <created>2015-05-21T03:19:59</created>
  <last-modified>2015-05-21T05:54:09</last-modified>
  <description></description>
  <user-visible>true</user-visible>
  <creator></creator>
 </id-perms>
 <display-name>vn-02899298</display-name>
</iq>"

Tags: base blocker
Revision history for this message
Tapan Karwa (tkarwa) wrote :

Currently, if config sets a boolean value in any node, we receive the right value in the incoming ifmap packet. But, the autogen code does not set the field with the incoming value.

Here is an example from today's codebase:

bool IsShared_ParseMetadata(const pugi::xml_node &parent, std::auto_ptr<AutogenProperty > *resultp) {
    VirtualNetwork::OolProperty *data = new VirtualNetwork::OolProperty();
    resultp->reset(data);
         <<<<<<<<<<<<<<<<< we should set data->data from the value in parent here.
    return true;
}

Here is the XML:
<contrail:is-shared xmlns:contrail="http://www.contrailsystems.com/vnc_cfg.xsd" ifmap-cardinality="singleValue" ifmap-publisher-id="api-server-1--0000000001-1" ifmap-timestamp="2015-05-22T09:25:59-07:00">
False
</contrail:is-shared>

Fixed autogen-code will look like:

bool IsShared_ParseMetadata(const pugi::xml_node &parent, std::auto_ptr<AutogenProperty > *resultp) {
    VirtualNetwork::OolProperty *data = new VirtualNetwork::OolProperty();
    resultp->reset(data);
    data->data = parent.text().as_bool();
    return true;
}

(gdb) p parent.type()
$11 = pugi::node_element
(gdb) p child.type()
$12 = pugi::node_pcdata
(gdb) p parent.value()
$13 = (const pugi::char_t *) 0xecf7c5 ""
(gdb) p child.value()
$14 = (const pugi::char_t *) 0x7f376576c66d "True"

The documentation says:
You can get the text object from a node by using text() method. If the node has a type node_pcdata or node_cdata, then the node itself is used to return data; otherwise, a first child node of type node_pcdata or node_cdata is used.
as_bool converts attribute value to boolean as follows: if attribute handle is null, def argument is returned (which is false by default). If attribute value is empty, false is returned. Otherwise, true is returned if the first character is one of '1', 't', 'T', 'y', 'Y'. This means that strings like "true" and "yes" are recognized as true, while strings like "false" and "no" are recognized as false.

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

Review in progress for https://review.opencontrail.org/10713
Submitter: Tapan Karwa (<email address hidden>)

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

Review in progress for https://review.opencontrail.org/10712
Submitter: Tapan Karwa (<email address hidden>)

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

Reviewed: https://review.opencontrail.org/10713
Committed: http://github.org/Juniper/contrail-generateDS/commit/0b3bb5d1591a012dd0df28ca1c172bc450d646ab
Submitter: Zuul
Branch: master

commit 0b3bb5d1591a012dd0df28ca1c172bc450d646ab
Author: Tapan Karwa <email address hidden>
Date: Fri May 22 11:03:20 2015 -0700

Fix c++ generateDS code to set bool.

Currently, if config sets a boolean value in any node, we receive the right
value in the incoming ifmap packet. But, the autogen code does not set the
field in the object with the incoming value. Fixing that.

Closes-Bug: 1457327

Change-Id: Iae61c2ba143e7063dd69c20ccc7d9404d1dd57fa

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

Reviewed: https://review.opencontrail.org/10712
Committed: http://github.org/Juniper/contrail-generateDS/commit/4b2633e38b473c2942cdf660a0a4aacbaf74eaa9
Submitter: Zuul
Branch: R2.20

commit 4b2633e38b473c2942cdf660a0a4aacbaf74eaa9
Author: Tapan Karwa <email address hidden>
Date: Fri May 22 11:03:20 2015 -0700

Fix c++ generateDS code to set bool.

Currently, if config sets a boolean value in any node, we receive the right
value in the incoming ifmap packet. But, the autogen code does not set the
field in the object with the incoming value. Fixing that.

Closes-Bug: 1457327

Change-Id: Iae61c2ba143e7063dd69c20ccc7d9404d1dd57fa

Nischal Sheth (nsheth)
tags: added: bas
removed: contrail-control
tags: added: base
removed: bas
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.