[CONTROLLER-924] depth parameter is not taken into account (see issues 225, 226) Created: 07/Oct/14  Updated: 25/Jul/23  Resolved: 26/Jun/15

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

Type: Bug
Reporter: Tigran Avanesov Assignee: Jan Hajnar
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
is blocked by YANGTOOLS-322 ImmutableMapNode insteadof ImmutableU... Resolved
is blocked by YANGTOOLS-349 JsonParserStream returns List instead... Resolved
External issue ID: 2155

 Description   

wget --user=admin --password=admin http://opendaylightof13:8181/restconf/operational//opendaylight-inventory:nodes
#...
wget --user=admin --password=admin http://opendaylightof13:8181/restconf/operational//opendaylight-inventory:nodes?depth\=0
#...
wget --user=admin --password=admin http://opendaylightof13:8181/restconf/operational//opendaylight-inventory:nodes?depth\=1
#...
wget --user=admin --password=admin http://opendaylightof13:8181/restconf/operational//opendaylight-inventory:nodes?depth\=2
#...
wget --user=admin --password=admin http://opendaylightof13:8181/restconf/operational//opendaylight-inventory:nodes?depth\=3
#...

ls -la

... 538732 Oct 7 11:26 opendaylight-inventory:nodes
... 538728 Oct 7 11:26 opendaylight-inventory:nodes?depth=0
... 538762 Oct 7 11:27 opendaylight-inventory:nodes?depth=1
... 538762 Oct 7 11:28 opendaylight-inventory:nodes?depth=2
... 538764 Oct 7 11:28 opendaylight-inventory:nodes?depth=3

(size is similar)

And there is more than 1 level:

<nodes xmlns="urn:opendaylight:inventory">
<node>
<id>openflow:16386</id>
<description xmlns="urn:opendaylight:flow:inventory">None</description>
<serial-number xmlns="urn:opendaylight:flow:inventory">None</serial-number>
<table xmlns="urn:opendaylight:flow:inventory">
<id>17</id>
<aggregate-flow-statistics xmlns="urn:opendaylight:flow:statistics">
<byte-count>0</byte-count>
<packet-count>0</packet-count>
<flow-count>0</flow-count>
</aggregate-flow-statistics>
<flow-table-statistics xmlns="urn:opendaylight:flow:table:statistics">
<active-flows>0</active-flows>
<packets-matched>0</packets-matched>
<packets-looked-up>0</packets-looked-up>
</flow-table-statistics>
</table>
<table xmlns="urn:opendaylight:flow:inventory">
<id>159</id>
<aggregate-flow-statistics xmlns="urn:opendaylight:flow:statistics">
<byte-count>0</byte-count>
<packet-count>0</packet-count>
<flow-count>0</flow-count>
</aggregate-flow-statistics>
<flow-table-statistics xmlns="urn:opendaylight:flow:table:statistics">
<active-flows>0</active-flows>

...

ODL built from l2switch git repository, commit 198eb176f265d9c3b2f349da5a5f54d4b392b171 (Oct 2 01:27:20 2014)
feature installed: odl-l2switch-switch-ui,
using karaf

Also Devin Avery said on mailing list:
"It would appear that the call to the code to handle depth was removed… we need to open a bug to fix that and figure out what removed it (and also why we didn’t have any unit tests fail…)"



 Comments   
Comment by Devin Avery [ 07/Oct/14 ]

Gerrit https://git.opendaylight.org/gerrit/#/c/10098/ removed the functionality calls and commented (ignored) out the tests so things would pass.

E-mail out to committer / author to understand why.

Comment by Devin Avery [ 07/Oct/14 ]

Moving to critical as this is a regression in functionality in the product which is our only means of reducing output in restconf when trying to search an endpoint

Comment by Tony Tkacik [ 07/Oct/14 ]

The implementation of depth parameter was done in way, that it allocated new set of objects, which could result in OutOfMemory error, just by reading data via Restconf.

The depth parameter needs to be addressed differently that it used to be differently,
in such way that it will not lead to allocate everything twice.

Comment by Devin Avery [ 08/Oct/14 ]

Tony - I agree that is a valid concern, but comments in code to indicate why it was removed and tests comment out would be helpful to others coming along later. Also generally speaking I am not a fan of removing functionality unless it is a critical concern. At which point if it is that much of a concern we should really try to fix it instead of remove it.

Comment by Jozef Gloncak [ 24/Oct/14 ]

change in:

Comment by Jozef Gloncak [ 10/Nov/14 ]

yangtools - https://git.opendaylight.org/gerrit/#/c/12227/

  • merged to stable/helium
  • cherry-picked to master

controller - https://git.opendaylight.org/gerrit/#/c/12229/ - wait for review

Comment by Jozef Gloncak [ 10/Nov/14 ]

yangtools

controller - https://git.opendaylight.org/gerrit/#/c/12229/ - wait for review

Comment by Vratko Polak [ 14/Apr/15 ]

> - cherry-picked to master - https://git.opendaylight.org/gerrit/#/c/12667/

Still not merged.
Helium is fixed, but as Lithium is now in focus, this bug should be opened until fix is in master.

Comment by Jan Hajnar [ 08/Jun/15 ]

patch for stable lithium:
https://git.opendaylight.org/gerrit/#/c/21675/

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