summaryrefslogtreecommitdiff
path: root/source3/tdb/tools
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-11-13 09:34:55 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:46 -0500
commit3a1ada7635a6b585747afc3885302a3557cf5fb8 (patch)
treebd8352589267a73a9bd5d03f7f62262eaa6b3958 /source3/tdb/tools
parentbef92ebb257adda6634c559e0240ad4991840212 (diff)
downloadsamba-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/tools')
-rw-r--r--source3/tdb/tools/tdbbackup.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/tdb/tools/tdbbackup.c b/source3/tdb/tools/tdbbackup.c
index f49cd339c7..4ae5a4f921 100644
--- a/source3/tdb/tools/tdbbackup.c
+++ b/source3/tdb/tools/tdbbackup.c
@@ -93,6 +93,7 @@ static void usage(void)
printf(" -h this help message\n");
printf(" -s suffix set the backup suffix\n");
printf(" -v verify mode (restore if corrupt)\n");
+ printf(" -n hashsize set the new hash size for the backup\n");
}
@@ -102,9 +103,10 @@ static void usage(void)
int ret = 0;
int c;
int verify = 0;
+ int hashsize = 0;
const char *suffix = ".bak";
- while ((c = getopt(argc, argv, "vhs:")) != -1) {
+ while ((c = getopt(argc, argv, "vhs:n:")) != -1) {
switch (c) {
case 'h':
usage();
@@ -115,6 +117,9 @@ static void usage(void)
case 's':
suffix = optarg;
break;
+ case 'n':
+ hashsize = atoi(optarg);
+ break;
}
}
@@ -138,7 +143,7 @@ static void usage(void)
}
} else {
if (file_newer(fname, bak_name) &&
- backup_tdb(fname, bak_name) != 0) {
+ backup_tdb(fname, bak_name, hashsize) != 0) {
ret = 1;
}
}