ovdb/groupinfo repair
Heath Kehoe
heath at nozzala.net
Wed Sep 20 05:26:07 UTC 2006
I'm not aware of a way to fix a too-high high mark, short of a bit of
hacking.
Fortunately, if you have the source code available, it's pretty easy
to make a custom version of expireover that can fix the high mark.
You just need a couple of small changes to storage/ovdb/ovdb.c (be
sure to save a copy of the original before editing):
About line 1071 (in the count_records function), after the three
memset(...) lines, put:
gi->high = 0;
The count_records function will only increase the high mark; so this
initializes it to zero before iterating over the articles.
Then at about line 2718, you should see these lines:
if(currentcount != gi.count) {
syslog(L_NOTICE, "OVDB: expiregroup: recounting %s", group);
Change the if(...) to look like this, so that count_records will be
called unconditionally:
if(1) {
syslog(L_NOTICE, "OVDB: expiregroup: recounting %s", group);
Then rebuild libstorage and expireover:
cd storage
make
cd ../expire
make expireover
mv expireover expireover-fix-himark
Then, run the custom expireover to fix individual groups like this
(you don't have to shut down innd first):
su news # unless you're already logged in as the news user
echo "alt.support.diet.low-carb" | ./expireover-fix-himark -f -
Don't forget to put the original ovdb.c back in place. You don't
normally want to use the modified version of expireover; for one, we
forced it to always recount each group, which could add significantly
to the runtime; also, you don't normally want to allow the high mark
to decrease.
-heath
On Sep 18, 2006, at 3:44 PM, Mark E. Mallett wrote:
> Hi-
>
> A set of misadventures have resulted in a couple of minor corruptions.
> I've been searching/reading until my head hurts, and figured I'd give
> up and ask here, for at least this one:
>
> INN-2.4.1 on a FreeBSD 5.x platform, using ovdb with Berkeley DB
> (3.3.11
> I believe). It's been running quite well for some time, long
> enough for
> me to forget about a lot of details :)
>
> For one group, the ovdb high-water mark has gotten out of whack,
> but only
> in the group summary:
>
> 752% ovdb_stat -g alt.support.diet.low-carb
> alt.support.diet.low-carb: groupstats: low: 839879, high: 30900285,
> count: 2665, flag: y
>
> "counting" (which I take to mean querying the individual ovdb records
> directly rather than relying on the group summary), gives:
>
> 753% ovdb_stat -c alt.support.diet.low-carb
> alt.support.diet.low-carb: counted: low: 839879, high: 842551,
> count: 2665
>
> And in the active file it's OK:
>
> 754% grep low-carb $DB/active
> alt.support.diet.low-carb 0000842551 0000839874 y
>
> The group summary number seems to come from the 'groupinfo' file; my
> thought was try try to repair that. But, short of hacking up some C
> code to write a new record, how? (I naively thought that if I move
> the groupinfo file out of the way, the ovdb_init program might try
> to rebuild it, but nope...)
>
> Thanks,
> -mm- (newly subscribed)
More information about the inn-workers
mailing list