[NETCONF-403] Eliminate blocking checks in loops, so the checks are done in parallel Created: 21/Apr/17  Updated: 23/Feb/21  Resolved: 23/Feb/21

Status: Resolved
Project: netconf
Component/s: restconf-nb
Affects Version/s: None
Fix Version/s: 1.13.0

Type: Bug
Reporter: Ivan Hrasko Assignee: Vladyslav Marchenko
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 NETCONF-405 Audit all code to make sure checks ar... Confirmed
Relates
relates to NETCONF-743 Regression in SSE Notification test Resolved
External issue ID: 8268

 Description   

Do not mix read and write operations in one loop.

This change is needed for old restconf (BrokerFacade.java) and also for new restconf (RestconfDataServiceImpl and its utility helper classes).



 Comments   
Comment by Ivan Hrasko [ 21/Apr/17 ]

This is follow up issue of https://bugs.opendaylight.org/show_bug.cgi?id=7868

Comment by Vladyslav Marchenko [ 07/Oct/20 ]

Changes are made only for rfc4080!
According to RFC6241, we need to do "if exists" check for "delete" and "create"operations.
Currently we have two scenarios:
1) when device is connected and we execute operation on device's datastore (using NetconfRestconfStrategy.java)
2) execute operation on local controller's datastore (using MdsalRestconfStrategy.java)

If request goes via NetconfRestconfStrategy.java we don't need to check existence on the controller side. As implementation of <edit-config> with "delete"/"create"operations - first must do "if exists" check. As en example see org.opendaylight.netconf.mdsal.connector.ops.EditConfig.java

If request goes via MdsalRestconfStrategy.java, first we need to do "if exists" check.
Read requests in this case, are collected in a batch and then collecting the results. (The same as was done in https://git.opendaylight.org/gerrit/c/netconf/+/55224)

For testing performance this script was used (with device simulator):
python cluster_rest_script.py --host localhost --port 8181 --threads 1 --itemcount 10000 --ipr 10000 --debug add

Before this patch:

Local datastore Device's datastore
~ 98 sec > 600 sec (failed by timeout)

After this patch:

Local datastore Device's datastore
~ 1,5 sec ~ 15 sec
Generated at Wed Feb 07 20:14:56 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.