summaryrefslogtreecommitdiff
path: root/lib/ntdb/test/api-60-noop-transaction.c
AgeCommit message (Collapse)AuthorFilesLines
2013-02-20ntdb: fix database corruption when transaction doesn't change anything.Rusty Russell1-0/+58
ntdb's transaction code has an optimization which tdb's doesnt: it only writes the parts of blocks whose contents have changed. This means we can actually have a transaction which turns out to need no recovery region. This breaks the recovery setup logic, which sets the current recovery size to 0 if there's no recovery area, and assumes that we'll always create a new recovery area since the recovery will always need > 0 bytes. In fact, if we really haven't changed anything, we can skip the transaction commit altogether: since this happens at least once with Samba, it's worth doing. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Reviewed-by: Andrew Bartlett <abartlet@samba.org>