From bc1d4424c5327f6e53efd4f21007c0704ca055d2 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 23 Feb 2013 19:04:13 -0800 Subject: [PATCH] Define MDB_WRITES_PER_COMMIT, default to 500 The former default of 1000 may fail for DBs with many indices. --- servers/slapd/back-mdb/tools.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/servers/slapd/back-mdb/tools.c b/servers/slapd/back-mdb/tools.c index 69a764e03d..10e40f706d 100644 --- a/servers/slapd/back-mdb/tools.c +++ b/servers/slapd/back-mdb/tools.c @@ -84,16 +84,24 @@ static void * mdb_tool_index_task( void *ctx, void *ptr ); static int mdb_writes, mdb_writes_per_commit; +/* Number of ops per commit in Quick mode. + * Batching speeds writes overall, but too large a + * batch will fail with MDB_TXN_FULL. + */ +#ifndef MDB_WRITES_PER_COMMIT +#define MDB_WRITES_PER_COMMIT 500 +#endif + static int mdb_tool_entry_get_int( BackendDB *be, ID id, Entry **ep ); int mdb_tool_entry_open( BackendDB *be, int mode ) { - /* In Quick mode, commit once per 1000 entries */ + /* In Quick mode, commit once per 500 entries */ mdb_writes = 0; if ( slapMode & SLAP_TOOL_QUICK ) - mdb_writes_per_commit = 1000; + mdb_writes_per_commit = MDB_WRITES_PER_COMMIT; else mdb_writes_per_commit = 1; -- 2.39.5