[NETVIRT-1077] get rid of WriteTransactions which will never be submitted Created: 02/Feb/18  Updated: 25/Nov/19  Resolved: 25/Nov/19

Status: Verified
Project: netvirt
Component/s: None
Affects Version/s: None
Fix Version/s: Magnesium

Type: Story Priority: Medium
Reporter: Valentina Krasnobaeva Assignee: Valentina Krasnobaeva
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

In NeutronvpnManager, NeutronvpnUtil, in functions, that perform WriteOnlyTransaction to ConfigDS you can often meet this references check for WriteTransaction object:

method UpdateSomething(...., Something something, WriteTransaction wrtConfigTxn) {

if (wrtConfigTxn == null)

{      wrtConfigTxn = dataBroker.newWriteOnlyTransaction(); }

...

and then there is a transaction call:

LOG.info("Updating something", something);
wrtConfigTxn.put(LogicalDatastoreType.CONFIGURATION, something, something.build());

....

}

So if wrtConfigTxn was null, newly created WriteOnlyTransaction will never be submitted to ConfigDS, because there is no any call wrtConfigTxn.submit().get().

So  in such methods bodies, we always sure, that existed wrtConfigTxn is passed by arguments, it is not null, except the moment, when we perform if (wrtConfigTxn == null).

Fortunately, some methods are really the case, we always call them with already existed wrtConfigTxn, so this check will be never executed.

Need to sanitize the code of neutron-vpn and vpnmanager packages, add  wrtConfigTxn.submit, when we create new transaction object inside a method.

 



 Comments   
Comment by Philippe Guibert [ 16/Feb/18 ]

lowering the priority of this ticket, since I think this is not the default workflow ( I mean that passed writetransaction is already provided, and then returned back).

 

Comment by Valentina Krasnobaeva [ 16/Feb/18 ]

Philippe, even in a subject of this issue, I've mentioned, that the problem is that

WriteTransactions  will never be submitted !

It means, that changes will never be written in DS !

Comment by Abhinav Gupta [ 25/Nov/19 ]

bug present and fixed in latest release

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