diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2013-02-17 20:56:34 +1030 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2013-02-20 05:31:19 +0100 |
commit | 3d82f786ecdd6747e90fe480a15de8c3fcea5f7b (patch) | |
tree | 4197bb0051b0effbae636d7dc559a433647ee428 /lib/ntdb/wscript | |
parent | 85b6329b91f402da474547410e82438ea2554775 (diff) | |
download | samba-3d82f786ecdd6747e90fe480a15de8c3fcea5f7b.tar.gz samba-3d82f786ecdd6747e90fe480a15de8c3fcea5f7b.tar.bz2 samba-3d82f786ecdd6747e90fe480a15de8c3fcea5f7b.zip |
ntdb: fix database corruption when transaction doesn't change anything.
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>
Diffstat (limited to 'lib/ntdb/wscript')
-rw-r--r-- | lib/ntdb/wscript | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/ntdb/wscript b/lib/ntdb/wscript index 1a4b02bb25..63c8402d66 100644 --- a/lib/ntdb/wscript +++ b/lib/ntdb/wscript @@ -72,6 +72,7 @@ def configure(conf): 'test/api-20-alloc-attr.c', 'test/api-21-parse_record.c', 'test/api-55-transaction.c', + 'test/api-60-noop-transaction.c', 'test/api-80-tdb_fd.c', 'test/api-81-seqnum.c', 'test/api-82-lockattr.c', |