[Date Prev][Date Next] [Chronological] [Thread] [Top]

BDB databases and DB_RECOVER

I just found this in back-bdb/init.c:bdb_db_open():

#if 0
	/* Never do automatic recovery, must perform it manually.
	 * Otherwise restarting with gentlehup will corrupt the
	 * database.
	if( !(slapMode & SLAP_TOOL_MODE) ) flags |= DB_RECOVER;

I'm not sure gentlehup is used often enough to warrant that limitation.
Besides, according to recent discussions, several slapd processes using
the same databases is not always safe anyway: only if the system and BDB
implementation supports interprocess shared locks, or whatever they were
called.  Maybe it's better to just strengthen the statement in
slapd.conf(5).gentlehup that if slapd is restarted while the old slapd
is running, it must be restarted _with another database_.

OTOH, I've been thinking of opening the databases in read-only mode if
the database is configured with "readonly on".  Then DB_RECOVER can't be
used either.  That way, several slapds can certainly run with the same
database, though as noted I'm not quite sure how useful that is.  Also,
I imagine slapd will be faster, since deadlock detection, logging and
maybe locking and transactions can be turned off.