mirror of
https://github.com/openvswitch/ovs
synced 2025-10-21 14:49:41 +00:00
ovsdb: Cleanly abort delete operations.
This commit is contained in:
@@ -82,6 +82,9 @@ ovsdb_txn_destroy(struct ovsdb_txn *txn, void (*cb)(struct ovsdb_txn_row *))
|
|||||||
struct ovsdb_txn_row, hmap_node,
|
struct ovsdb_txn_row, hmap_node,
|
||||||
&txn_table->txn_rows)
|
&txn_table->txn_rows)
|
||||||
{
|
{
|
||||||
|
if (txn_row->old) {
|
||||||
|
txn_row->old->txn_row = NULL;
|
||||||
|
}
|
||||||
if (txn_row->new) {
|
if (txn_row->new) {
|
||||||
txn_row->new->txn_row = NULL;
|
txn_row->new->txn_row = NULL;
|
||||||
}
|
}
|
||||||
|
@@ -382,3 +382,29 @@ print:
|
|||||||
2: i=2, j=3],
|
2: i=2, j=3],
|
||||||
[transaction])
|
[transaction])
|
||||||
|
|
||||||
|
OVSDB_CHECK_POSITIVE([deletes are aborted cleanly],
|
||||||
|
[[transact \
|
||||||
|
'["insert", "1", "2", "3"]' \
|
||||||
|
'["commit"]' \
|
||||||
|
'["print"]' \
|
||||||
|
'["delete", "1"]' \
|
||||||
|
'["abort"]' \
|
||||||
|
'["print"]' \
|
||||||
|
'["delete", "1"]' \
|
||||||
|
'["abort"]' \
|
||||||
|
'["print"]']],
|
||||||
|
[dnl
|
||||||
|
insert 1 2 3:
|
||||||
|
commit:
|
||||||
|
print:
|
||||||
|
1: i=2, j=3
|
||||||
|
delete 1:
|
||||||
|
abort:
|
||||||
|
print:
|
||||||
|
1: i=2, j=3
|
||||||
|
delete 1:
|
||||||
|
abort:
|
||||||
|
print:
|
||||||
|
1: i=2, j=3],
|
||||||
|
[transaction])
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user