[CONTROLLER-762] Applications that use the MD-SAL Datastore should properly handle OptimisticLock and ConflictingModification exceptions Created: 04/Sep/14  Updated: 19/Oct/17  Resolved: 27/Oct/14

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

Type: Improvement
Reporter: Moiz Raja Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Mac OS
Platform: PC


Issue Links:
Blocks
is blocked by CONTROLLER-758 Rework StatisticsManager to use Inven... Resolved
is blocked by CONTROLLER-759 Rework TopologyManager to use transac... Resolved
is blocked by L2SWITCH-7 L2 Switch must handle OptimisticLockE... Resolved

 Description   

Many applications that use the MD-SAL Datastore do not properly handle commit failures that may happen due to conflicting modifications or optimistic lock exceptions. Many applications were written pre-hydrogen when these exceptions did not exist. These applications need to be modified to ensure one of two things,

a. Minimizing the occurrences of conflicts by using some of the new APIs in the datstore.

b. Properly handling any exceptions that happen to ensure that data is not lost.

Here are some initial thoughts from Ed,

1) Mitigation Strategies (reduce incidence):
a) Can you use merge instead of put?
b) If you are doing an ordered set of things, are you using a TransactionChain?
c) Are you doing a write in response to a Notification? Is anyone else… if so, probably only one of you should do the write, and the others use DataChangeListeners

2) In spite of Mitigation, you still need to handle it so:
a) Register a Callback for the Future to handle the failure
b) At the very minimum: Log



 Comments   
Comment by Alexander Fan [ 24/Sep/14 ]

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

Comment by Alexander Fan [ 24/Sep/14 ]

Sorry, undoing my comment – was in the wrong bug.

Comment by Tony Tkacik [ 27/Oct/14 ]

THis bug should be opened for particular projects, who offends API contracts.

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