[MDSAL-246] Re-align data interaction model with RFCs 6241/8040/8072 Created: 21/Apr/17  Updated: 09/Jan/24

Status: Confirmed
Project: mdsal
Component/s: Binding API, DOM API
Affects Version/s: None
Fix Version/s: 14.0.0

Type: Epic Priority: High
Reporter: Ivan Hrasko Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Blocks
blocks NETCONF-474 Add support for insert in user-ordere... Open
blocks NETCONF-257 Improvement of code by remove read op... Resolved
Duplicate
duplicates CONTROLLER-1639 Add a create() method Resolved
Epic Name: MD-SAL patch

 Description   

Add method which creates data if data does not already exists, otherwise throws error.

RFC: https://tools.ietf.org/html/rfc6241#page-38 part about create method



 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 Robert Varga [ 21/May/17 ]

RFC 8040 defines the set of operations which we need to provide on the northbound. This notably includes more operations and the ietf-yang-patch model, which we should support in binding.

Comment by Robert Varga [ 21/May/17 ]

While most functionality can be provided by RESTCONF using emulation, which works reasonably well in local node scenarios, it is very clunky and error-prone.

In clustered scenarios the emulation layer needs to perform multiple operations, typicaly exists(), followed by puts(), which is inefficient as it:

  • adds 'read' aspect to otherwise write-only transactions
  • incurs multiple messages

Hence providing native support to these operations will provide significant performance benefits.

ietf-yang-patch defines effectively a DSL for expressing data store transformations, hence the set of operations we can provide to the end user (via DOM and Binding APIs) will vastly expand.

Comment by Robert Varga [ 10/Oct/17 ]

This is gaining criticality, as users are increasing using user-ordered lists, which require insert/point support as hinted in NETCONF WG RFCs.

The write side of APIs need to realigned with RFC 8072, which defines the following operations:

RFC ReadWriteTransaction equivalent
=== ===============================
CREATE exists() + put()
DELETE exists() + delete()
INSERT read() + put()
MERGE merge()
MOVE read() + put()
REPLACE put()
REMOVE delete()

Furthermore https://tools.ietf.org/html/rfc8040#section-4.5 requires REPLACE operation to indicate whether a new item was created or a previous one was replaced. This use case can be supported via invoking an exists() operation before the modification, recording its (future) result – and relying on transaction isolation/reconciliation to throw OptimisticLockFailedException.

The read side of APIs really just need to support depth/fields requests. Since this data access pattern would result in partial subtrees being reported, I think we can forgo that optimization for now and perform filtering in the NETCONF/RESTCONF components.

https://tools.ietf.org/html/rfc6241#section-6 additionally specifies subtree filtering capabilities, which are probably best served via (an optional) XPath evaluation engine.

Comment by OpenDaylight Release [ 03/May/18 ]

Robert, for now I'm assigning this to you.

Please decide if it should be moved to someone else.

Comment by Robert Varga [ 03/May/18 ]

This one is on the backlog – we don't assign issues until someone actively is going to work on them.

Comment by Robert Varga [ 09/Jul/21 ]

We certainly want to use RFC8072 yang-data objects for modeling binding-api requests.

At DOM we probably want to go dual mode: based on NormalizedNode and API-driven, with a friendly Java API. If that is the case, one of those should be just a default method overlay in interfaces.

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