[CONTROLLER-900] sal-compatibility not get up-to-date flow information. Created: 25/Sep/14  Updated: 19/Oct/17  Resolved: 05/May/15

Status: Resolved
Project: controller
Component/s: adsal
Affects Version/s: Helium
Fix Version/s: None

Type: Bug
Reporter: Hideyuki Tai Assignee: Kamal Rameshan
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Blocks
blocks VTN-40 Failed to get up-to-date flow statist... Resolved
External issue ID: 2098

 Description   

sal-compatibility does not get up-to-date flow information.
This is the root cause of VTN-40.

InventoryAndReadAdapter class of sal-compatibility implements readAllFlow method.
List<FlowOnNode> readAllFlow(final Node node, final boolean cached).

When the second parameter "cached" is false, this method must get flow information directly from the hardware node, and return it.

https://jenkins.opendaylight.org/controller/job/controller-merge/lastSuccessfulBuild/artifact/target/apidocs/org/opendaylight/controller/sal/reader/IPluginInReadService.html#readAllFlow(org.opendaylight.controller.sal.core.Node,%20boolean)

However, the implementation of this method does not check the second parameter "cached", and it always returns cached information even if the second parameter "cached" is false.

InventoryAndReadAdapter.java
----------------------------

controller/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/InventoryAndReadAdapter.java

253 @Override
254 public List<FlowOnNode> readAllFlow(final Node node, final boolean cached) {
255 final ArrayList<FlowOnNode> output = new ArrayList<>();
256 final Table table = readOperationalTable(node, OPENFLOWV10_TABLE_ID);
257 if (table != null) {
258 final List<Flow> flows = table.getFlow();
259 LOG.trace("Number of flows installed in table 0 of node {} : {}", node, flows.size());
260
261 for (final Flow flow : flows) {
262 final FlowStatisticsData statsFromDataStore = flow.getAugmentation(FlowStatisticsData.class);
263 if (statsFromDataStore != null)

{ 264 final FlowOnNode it = new FlowOnNode(ToSalConversionsUtils.toFlow(flow, node)); 265 output.add(addFlowStats(it, statsFromDataStore.getFlowStatistics())); 266 }

267 }
268 }
269
270 return output;
271 }



 Comments   
Comment by Colin Dixon [ 26/Sep/14 ]

Is this actually blocking? Returning cached stats is the expected behavior here.

Comment by Colin Dixon [ 26/Sep/14 ]

If strictly up-to-date information is required, RPCs to do this can be accessed via the MD-SAL flow-services APIs. That could be added and fixed in the VTN.

Comment by Ed Warnicke [ 27/Sep/14 ]

There is a candidate fix here:

https://git.opendaylight.org/gerrit/#/c/11631/

Hideyuki, please test.

Comment by Hideyuki Tai [ 29/Sep/14 ]

(In reply to Ed Warnicke from comment #3)
> There is a candidate fix here:
>
> https://git.opendaylight.org/gerrit/#/c/11631/
>
> Hideyuki, please test.

I've tested the patch, and I've added my comment into the Gerrit.
https://git.opendaylight.org/gerrit/#/c/11631/

It seems to me that the patch does not fix the issue.
When I had VTN Manager call the readAllFlow method, NPE occurred.

Comment by Kamal Rameshan [ 01/Oct/14 ]

Controller: https://git.opendaylight.org/gerrit/#/c/11631/ and

OFP : https://git.opendaylight.org/gerrit/#/c/11655/

submitted.

Hideyuki, please retest and let me know.

Comment by Hideyuki Tai [ 01/Oct/14 ]

(In reply to Kamal Rameshan from comment #5)
> Controller: https://git.opendaylight.org/gerrit/#/c/11631/ and
>
> OFP : https://git.opendaylight.org/gerrit/#/c/11655/
>
> submitted.
>
> Hideyuki, please retest and let me know.

Hi Kamal,

I've tested the patches, and confirmed that the patches fixed the CONTROLLER-900.

Comment by Colin Dixon [ 02/Oct/14 ]

Per Hideyuki's comments, I'm marking this bug as fixed.

Comment by Kamal Rameshan [ 02/Oct/14 ]

Hi Colin,

The gerrits are not yet merged, so techinically the status should be "waiting_for_review".

Unless my understanding on bugzilla status is wrong.

Comment by Tony Tkacik [ 22/Oct/14 ]

Please rebase controller patch in order to merge it.

Comment by Hideyuki Tai [ 10/Nov/14 ]

The patches have been merged into master branches.
https://git.opendaylight.org/gerrit/#/c/11631/
https://git.opendaylight.org/gerrit/#/c/11655/

And the patches also have been merged into stable/helium branches.
https://git.opendaylight.org/gerrit/#/c/12276/
https://git.opendaylight.org/gerrit/#/c/11919/

Comment by Carol Sanders [ 05/May/15 ]

This bug is part of the project to Move all ADSAL associated component bugs to ADSAL.

Generated at Wed Feb 07 19:54:10 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.