diff options
author | Volker Lendecke <vlendec@samba.org> | 2006-11-13 09:34:55 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:15:46 -0500 |
commit | 3a1ada7635a6b585747afc3885302a3557cf5fb8 (patch) | |
tree | bd8352589267a73a9bd5d03f7f62262eaa6b3958 /source3/tdb/common/dump.c | |
parent | bef92ebb257adda6634c559e0240ad4991840212 (diff) | |
download | samba-3a1ada7635a6b585747afc3885302a3557cf5fb8.tar.gz samba-3a1ada7635a6b585747afc3885302a3557cf5fb8.tar.bz2 samba-3a1ada7635a6b585747afc3885302a3557cf5fb8.zip |
r19685: Two changes inspired by problems with huge tdbs. tdbtool's list command now
prints the hash on every record for easier awk'ing, and tdbbackup allows a
different hash chain length on the backed up tdb.
Jeremy, Günther, this might be interesting for you huge domains. Not only
locking.tdb, also the winbind ones might grow huge.
In the installation I fixed with this winbind spent a huge amount of CPU
spinning through a degenerated winbindd_idmap.tdb with entries for more than
15.000 users. With a default number of hash chains of 131 on that tdb you can
imagine that the lists get large.
Not merging to 4, I don't get tdbbackup to compile there right now.
What about changing the global default hash chain number to be dramatically
larger? Disk is cheap these days.
Volker
(This used to be commit 577d0ff658596f8246f120e0342cc5c9e4077ece)
Diffstat (limited to 'source3/tdb/common/dump.c')
-rw-r--r-- | source3/tdb/common/dump.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source3/tdb/common/dump.c b/source3/tdb/common/dump.c index 577f23aac6..70382ca949 100644 --- a/source3/tdb/common/dump.c +++ b/source3/tdb/common/dump.c @@ -28,7 +28,8 @@ #include "tdb_private.h" -static tdb_off_t tdb_dump_record(struct tdb_context *tdb, tdb_off_t offset) +static tdb_off_t tdb_dump_record(struct tdb_context *tdb, int hash, + tdb_off_t offset) { struct list_struct rec; tdb_off_t tailer_ofs, tailer; @@ -39,8 +40,10 @@ static tdb_off_t tdb_dump_record(struct tdb_context *tdb, tdb_off_t offset) return 0; } - printf(" rec: offset=0x%08x next=0x%08x rec_len=%d key_len=%d data_len=%d full_hash=0x%x magic=0x%x\n", - offset, rec.next, rec.rec_len, rec.key_len, rec.data_len, rec.full_hash, rec.magic); + printf(" rec: hash=%d, offset=0x%08x next=0x%08x rec_len=%d " + "key_len=%d data_len=%d full_hash=0x%x magic=0x%x\n", + hash, offset, rec.next, rec.rec_len, rec.key_len, rec.data_len, + rec.full_hash, rec.magic); tailer_ofs = offset + sizeof(rec) + rec.rec_len - sizeof(tdb_off_t); @@ -72,7 +75,7 @@ static int tdb_dump_chain(struct tdb_context *tdb, int i) printf("hash=%d\n", i); while (rec_ptr) { - rec_ptr = tdb_dump_record(tdb, rec_ptr); + rec_ptr = tdb_dump_record(tdb, i, rec_ptr); } return tdb_unlock(tdb, i, F_WRLCK); |