[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Subversion's use of Berkeley DB [#11511]

From: Justin Erenkrantz <justin_at_erenkrantz.com>
Date: 2004-12-08 22:43:19 CET

--On Wednesday, December 8, 2004 3:10 PM -0500 Keith Bostic
<bostic@abyssinian.sleepycat.com> wrote:

> I didn't realize that was possible -- my understanding was there
> was no way to get Apache to tell a module that it was being called
> for the first time. Is that not true?

Correct, that's not true. For 2.x (and the same trick works in 1.3 with some
variation in technique), a module can know whether it's being initialized the
first (or second or whatever) time by leaving a 'note' in the process pool.
So, you can have a post_config hook that checks the apr_pool_userdata on the
process pool and then either runs or doesn't run. (The process pool of the
parent always always stays the same.)

An example is suexec_post_config in suExec:

<http://svn.apache.org/repos/asf/httpd/httpd/trunk/modules/generators/mod_suexec.c>

For 2.2, we might add a more direct way to do this; but this technique does
work on 2.0 and many of our core modules use this.

>> Don't I recall you (or someone else) advising that we always run
>> recovery on process initialization? Would that work here?
>
> Yes, Subversion should always run recovery on process initialization.

Then, a post-config hook may be the best place for SVN to do this check via
libsvn_fs_base. The additional bonus is that if the recovery fails, then
httpd won't even start, either. -- justin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Dec 8 22:44:34 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.