On Tue, Jun 10, 2014 at 10:03:52AM -0700, Alex Wang wrote:
> This commit adds logic that checks the return value of status_txn
> transaction and runs the update again if the transaction fails
> (transaction status is not 'TXN_SUCCESS', 'TXN_UNCHANGED', or
> 'TXN_INCOMPLETE').
>
> To keep the code simple, the re-run of update on transaction failure
> will extracts the status from all interfaces, rather than just those
> that have status change. Since the transaction failure is considered
> to be very rare, such overhead is deemed to be affordable.
>
> Bug #1256577
>
> Signed-off-by: Alex Wang <[email protected]>
TXN_UNCOMMITTED should not be possible here (because we just committed
it). If you want to check for it (I probably wouldn't bother) then
I'd use an assertion:
> + /* Sets the 'status_txn_try_again' if the transaction fails. */
> + if (status == TXN_SUCCESS || status == TXN_UNCOMMITTED) {
> + status_txn_try_again = false;
> + } else {
> + status_txn_try_again = true;
> + }
Acked-by: Ben Pfaff <[email protected]>
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev