2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-17 14:28:02 +00:00

ovsdb: Cleanly abort delete operations.

This commit is contained in:
Ben Pfaff
2009-12-11 12:58:30 -08:00
parent 577aebdfec
commit ee9e92d81a
2 changed files with 29 additions and 0 deletions

View File

@@ -82,6 +82,9 @@ ovsdb_txn_destroy(struct ovsdb_txn *txn, void (*cb)(struct ovsdb_txn_row *))
struct ovsdb_txn_row, hmap_node,
&txn_table->txn_rows)
{
if (txn_row->old) {
txn_row->old->txn_row = NULL;
}
if (txn_row->new) {
txn_row->new->txn_row = NULL;
}

View File

@@ -382,3 +382,29 @@ print:
2: i=2, j=3],
[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])