ovsdb: Truncate bad transactions from database log.
authorBen Pfaff <blp@nicira.com>
Mon, 28 Mar 2011 20:05:40 +0000 (13:05 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 17 May 2011 20:27:30 +0000 (13:27 -0700)
commitaf7367bc2f32eff031b94260c62528418c59c22d
tree5a8622ed0fb7474507a6ffce1cfa125802760c4c
parentf49cc5d2ee29ee90a5a08babfee55479c579bf27
ovsdb: Truncate bad transactions from database log.

When ovsdb-server reads a database file that is corrupted at the
transaction level (that is, the transaction is valid JSON and has the
correct SHA-1 hash, but it does not describe a valid database transaction),
then ovsdb-server should truncate it and overwrite it by valid
transactions.  However, until now, it didn't.  Instead, it would keep the
invalid transaction and possibly every transaction in the database file
(depending on in what way the transaction was invalid), which would just
cause the same trouble again the next time the database was read.

This fixes the problem.  An invalid transaction will be deleted from the
database file at the first write to the database.

Bug #5144.
Bug #5149.
ovsdb/file.c
ovsdb/log.c
ovsdb/log.h
tests/ovsdb-server.at