[Samba] tdbtool repack fails

Andrej Gessel andrej.gessel at janztec.com
Thu Aug 2 13:53:37 UTC 2018

Hello list,

I try to repack(tdbtool repack) my "dc=domain,dc=com.ldb" file:

tdb> info
Size of file/data: 3388084000/1050098055
Header offset/logical size: 0/3388084000
Number of records: 669737
Incompatible hash: no
Active/supported feature flags: 0x00000000/0x00000001
Robust mutexes locking: no
Smallest/average/largest keys: 12/57/242
Smallest/average/largest data: 72/1510/1235987
Smallest/average/largest padding: 5/412/252927
Number of dead records: 2
Smallest/average/largest dead records: 399912712/661866360/923820008
Number of free records: 38999
Smallest/average/largest free records: 12/18485/715170720
Number of hash chains: 10000
Smallest/average/largest hash chains: 26/66/116
Number of uncoalesced records: 253
Smallest/average/largest uncoalesced runs: 1/1/2
Percentage keys/data/padding/free/dead/rechdrs&tailers/hashes: 

it ends with this error:

tdb_recovery_allocate: overflow recovery area
tdb_transaction_prepare_commit: failed to setup recovery data
../lib/tdb/common/tdb.c:1055 Failed to commit

I follow the code and found this line:


         /* New head will be at end of file. */
         recovery_head = tdb->map_size;

In my case it means following:

my filesize is 3,3GB, old recovery_head was on 2064351232, size of old 
recovery was about 923820008, size of new recovery should be 1323794228, 
after tdb_free of old recovery area and setting the new recovery head to 
end of file(tdb->map_size), it is no more place for new recovery area, 
so the next check returns "overflow recovery area".

I'm now thinking about how it should be fixed? I thinking about to 
improve the checks and maybe search for last data entry and set new 
recovery head behind it?


More information about the samba mailing list