[OVSDB-302] CSIT southbound-all tests failing because hwvtep and southbound are both enabled Created: 16/Feb/16  Updated: 30/Oct/17  Resolved: 04/Mar/16

Status: Resolved
Project: ovsdb
Component/s: Southbound.hw_vtep
Affects Version/s: unspecified
Fix Version/s: None

Type: Bug
Reporter: Sam Hague Assignee: Vishal Thapar
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Text File karaf.log    
External issue ID: 5366

 Description   

The below exception comes out during the southbound-all tests. Code was added to allow both the southbound and hwvtepsouthbound to be running at the same time. Each southbound would ignore schemas it did not care about, but the hwvtep is complaining about the open_vswtich schema - which is shouldn't.

2016-02-16 17:44:47,126 | WARN | pool-30-thread-1 | HwvtepConnectionInstance | 406 - org.opendaylight.ovsdb.hwvtepsouthbound-impl - 1.2.1.Beryllium | Exception attempting to createTransactionInvokers ConnectionInfo [_localIp=IpAddress [_ipv4Address=Ipv4Address [_value=10.30.11.166], _value=[1, 0, ., 3, 0, ., 1, 1, ., 1, 6, 6]], _localPort=PortNumber [_value=6640], _remoteIp=IpAddress [_ipv4Address=Ipv4Address [_value=10.30.11.8], _value=[1, 0, ., 3, 0, ., 1, 1, ., 8]], _remotePort=PortNumber [_value=55870], augmentation=[]]: java.util.concurrent.ExecutionException: org.opendaylight.ovsdb.lib.error.ParsingException: bad DatabaseSchema root, expected "tables" as child but was not found
2016-02-16 17:44:47,128 | WARN | pool-30-thread-1 | HwvtepConnectionManager | 406 - org.opendaylight.ovsdb.hwvtepsouthbound-impl - 1.2.1.Beryllium | Not able to fetch schema for database hardware_vtep from device ConnectionInfo [Remote-address=10.30.11.8, Remote-port=55870, Local-address10.30.11.166, Local-port=6640, type=PASSIVE]
java.util.concurrent.ExecutionException: org.opendaylight.ovsdb.lib.error.ParsingException: bad DatabaseSchema root, expected "tables" as child but was not found
at com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:299)[39:com.google.guava:18.0.0]
at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:286)[39:com.google.guava:18.0.0]
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:116)[39:com.google.guava:18.0.0]
at org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepConnectionManager.getHwvtepGlobalTableEntry(HwvtepConnectionManager.java:287)[406:org.opendaylight.ovsdb.hwvtepsouthbound-impl:1.2.1.Beryllium]
at org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepConnectionManager.getEntityFromConnectionInstance(HwvtepConnectionManager.java:325)[406:org.opendaylight.ovsdb.hwvtepsouthbound-impl:1.2.1.Beryllium]
at org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepConnectionManager.registerEntityForOwnership(HwvtepConnectionManager.java:251)[406:org.opendaylight.ovsdb.hwvtepsouthbound-impl:1.2.1.Beryllium]
at org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepConnectionManager.connected(HwvtepConnectionManager.java:100)[406:org.opendaylight.ovsdb.hwvtepsouthbound-impl:1.2.1.Beryllium]
at org.opendaylight.ovsdb.lib.impl.OvsdbConnectionService$5.run(OvsdbConnectionService.java:375)[141:org.opendaylight.ovsdb.library:1.2.1.Beryllium]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_85]
at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_85]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)[:1.7.0_85]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[:1.7.0_85]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_85]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_85]
at java.lang.Thread.run(Thread.java:745)[:1.7.0_85]
Caused by: org.opendaylight.ovsdb.lib.error.ParsingException: bad DatabaseSchema root, expected "tables" as child but was not found
at org.opendaylight.ovsdb.lib.schema.DatabaseSchema.fromJson(DatabaseSchema.java:87)[141:org.opendaylight.ovsdb.library:1.2.1.Beryllium]
at org.opendaylight.ovsdb.lib.impl.OvsdbClientImpl$8.apply(OvsdbClientImpl.java:328)[141:org.opendaylight.ovsdb.library:1.2.1.Beryllium]
at org.opendaylight.ovsdb.lib.impl.OvsdbClientImpl$8.apply(OvsdbClientImpl.java:324)[141:org.opendaylight.ovsdb.library:1.2.1.Beryllium]
at com.google.common.util.concurrent.Futures$2.apply(Futures.java:760)[39:com.google.guava:18.0.0]
at com.google.common.util.concurrent.Futures$ChainingListenableFuture.run(Futures.java:906)[39:com.google.guava:18.0.0]
at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:457)[39:com.google.guava:18.0.0]
at com.google.common.util.concurrent.ExecutionList.executeListener(ExecutionList.java:156)[39:com.google.guava:18.0.0]
at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:145)[39:com.google.guava:18.0.0]
at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:185)[39:com.google.guava:18.0.0]
at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:53)[39:com.google.guava:18.0.0]
at org.opendaylight.ovsdb.lib.jsonrpc.JsonRpcEndpoint.processResult(JsonRpcEndpoint.java:144)[141:org.opendaylight.ovsdb.library:1.2.1.Beryllium]
at org.opendaylight.ovsdb.lib.jsonrpc.JsonRpcServiceBinderHandler.channelRead(JsonRpcServiceBinderHandler.java:43)[141:org.opendaylight.ovsdb.library:1.2.1.Beryllium]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318)[99:io.netty.transport:4.0.33.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304)[99:io.netty.transport:4.0.33.Final]
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:276)[100:io.netty.codec:4.0.33.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:263)[100:io.netty.codec:4.0.33.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318)[99:io.netty.transport:4.0.33.Final]
at

io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304)[99:io.netty.transport:4.0.33.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)[99:io.netty.transport:4.0.33.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)[99:io.netty.transport:4.0.33.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)[99:io.netty.transport:4.0.33.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)[99:io.netty.transport:4.0.33.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)[99:io.netty.transport:4.0.33.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)[99:io.netty.transport:4.0.33.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)[98:io.netty.common:4.0.33.Final]
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)[98:io.netty.common:4.0.33.Final]
... 1 more



 Comments   
Comment by Sam Hague [ 16/Feb/16 ]

Attachment karaf.log has been added with description: karaf.log

Comment by Sam Hague [ 16/Feb/16 ]

https://jenkins.opendaylight.org/releng/job/ovsdb-csit-1node-southbound-all-beryllium/802/

Comment by Vishal Thapar [ 18/Feb/16 ]

This exception is being logged from code that tries to register txInvokers. It tries to get hwvtep schema and if not found logs this warning msg. Code can be improved to not require stack trace when hwvtep schema is not present. I believe similar fix will be needed in OvsdbConnectionManager too as this will happen in cases where both are enabled but hwvtep is the only schema available.

I'll come up with a fix for this and then can discuss it in the gerrit patch.

Comment by Vishal Thapar [ 18/Feb/16 ]

Rview: https://git.opendaylight.org/gerrit/#/c/34913/

Comment by Vishal Thapar [ 26/Feb/16 ]

Alright, looks like we need to revisit this as fix is not working as expected.

First, let us talk about the problem seen in original bug. This is the code that we have in OVSDB/HWvtep ConnectionManager for passive connections [note: issue is only with passive connections, only change added in fix was the if statement].

if(externalClient.getSchema(SouthboundConstants.OPEN_V_SWITCH) != null)

{ OvsdbConnectionInstance client = connectedButCallBacksNotRegistered(externalClient); // Register Cluster Ownership for ConnectionInfo registerEntityForOwnership(client); }

Looking at these trace entries:
[39:com.google.guava:18.0.0]
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:116)[39:com.google.guava:18.0.0]
at org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepConnectionManager.getHwvtepGlobalTableEntry(HwvtepConnectionManager.java:287)[406:org.opendaylight.ovsdb.hwvtepsouthbound-impl:1.2.1.Beryllium]

The exception is happening at client.getSchema("hardware_vtep"), exactly the sort of code we added in if condition. Funny thing is, if you look further down stack trace it is coming from registerEntityForOwnership() while exact same call [getSchema] is also present in connectedButCallBacksNotRegistered(). So why didn't we run into it earlier?

Secondly, the issue seen post fix is this:
1. Have both plugins running.
2. Connect an OVS and HWVTEP node to controller [passive connection].
3. First one will go through fine.
4. Second one will connect, but nothing will show up in topology. In fact OvsdbConnectionService will not even call connected() for second one.

Basically, even attempting to get non-existent schema from a node screws up ConnectionService. Looks like that thread just abandons ship and disappears.

Thirdly, I add try catch around the if statements and changed it to externalClient.getSchema(SouthboundConstants.OPEN_V_SWITCH).get() When I do this I don't even hit the catch.

I am not familiar with how library code works with all the ListenableFutures, but one way could be to get the schemas/dbs present on device at connect itself and once we get that only then call the listeners. This way when conenctionManager.connected() is called we don't need to fetch DB/schema from the device.

Comment by Vishal Thapar [ 26/Feb/16 ]

This patch https://git.opendaylight.org/gerrit/#/c/35478/ seems to work fine. Could anyone explain why this works and previous one didn't?

Comment by Vishal Thapar [ 04/Mar/16 ]

Fixed by https://git.opendaylight.org/gerrit/35478 and verified.

Generated at Wed Feb 07 20:36:02 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.