[CONTROLLER-235] DataStore should be able to handle missing keys in writes Created: 27/Mar/14  Updated: 25/Jul/23  Resolved: 09/Sep/14

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

Type: Improvement
Reporter: Robert Varga Assignee: Tony Tkacik
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All



 Description   

With binding aware APIs, it is a common mistake to write an object into a particular point in the list (e.g. identifier with a target key), but fail to attach that key into the DTO being stored there.

Given that the datastore has both data points, it can trivially correct for this mistake, allowing it to continue instead of producing a hard error.

Implement this recovery strategy, along with a very stern LOG.warn(), which will detail the entry which was being written and the call stack where the transaction was allocated.



 Comments   
Comment by David Bainbridge [ 29/May/14 ]

(In reply to Robert Varga from comment #0)
> With binding aware APIs, it is a common mistake to write an object into a
> particular point in the list (e.g. identifier with a target key), but fail
> to attach that key into the DTO being stored there.
>
> Given that the datastore has both data points, it can trivially correct for
> this mistake, allowing it to continue instead of producing a hard error.
>
> Implement this recovery strategy, along with a very stern LOG.warn(),
> which will detail the entry which was being written and the call stack where
> the transaction was allocated.

Just want to make sure I understand the bug correctly. When utilizing the data store and putting an object into the tree (config or operational) the Node has an ID that should be identical to the location in the tree in which it is being placed. In some cases, the node is created without this ID, but when doing the write transaction since the code has both the ID and the node it can effectively WARN and proceed by setting the implied identifier in the Node. It this an accurate characterization?

Assuming the characterization is correct and assuming that differing data stores can be implemented it would be best to implement this before control gets to a specific implementation.

Comment by Robert Varga [ 29/May/14 ]

Correct. By „data store“ I really meant one of the binding-aware components, for example the BI connector, which is in the sweetspot for this kind of thing:

It already generates BI data, so adding a few additional leaves should not have a major impact.

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