🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #81406

Re: Q: Regarding overview creation and the active file.

#81406
From: D. Stussy
Date: Tue, 16 Jun 2009 02:45
77 lines
4276 bytes
"Russ Allbery" <rra@stanford.edu> wrote in message
news:87hbyhx90e.fsf@windlord.stanford.edu...
> "D. Stussy" <spam@bde-arc.ampr.org> writes:
> > In file:  storage/tradindexed/tdx-group.c, routine hashmap_load()
> >
> > I note that in the while-loop, we read EVERY entry from the active file
and
> > create a hash for it.  As this is to determine OVERVIEW data, I
question
> > whether we need to do this.  Should we SKIP entries marked "j", "x",
and
> > "=" because those "groups" will always be EMPTY ("j" will file in
"junk",
> > "x" will be rejected, and "=" will file in the alias group).  Only
groups
> > marked with "m", "n", and "y" will be non-empty.  (I note that groups
> > marked with "j", "x", or "=" or which were previously removed may have
> > residual overview data).  Is it this loop that effectively causes
"empty"
> > overview files to be created?
> >
> > Or is it the loop in index_audit_active() that causes this?
> >
> > I recognize that nnrpd may need empty overview files to know that a
group
> > exists, but when a group is declared as "j", "x", or "=", does it
"really"
> > exist (for this purpose)?
>
> You'd have to check the nnrpd code to be sure, but I think it gets
> everything about groups in some places, including the flag, from
> overview.  If that's the case, they need to be present in overview for
> nnrpd to behave correctly for those groups (which is not quite the same
> as having them not exist).

OK.

I think I found a better spot to test the change:  Same file, but in
tdx_index_add().  In the section headed by the comment "Initialize the
entry" (about line 650), I think the best way to do this is to go ahead and
init. the entry down to and including "entry->flag", but then based on the
actual value of that flag, optionally skip "data = tdx_data_new()" through
"tdx_data_close()".  Therefore, everything seems to look the same with the
following two exceptions:

1)  the files will actually NOT be created, and
2)  "entry->indexinode" will be left at its default value (zero).

I have not fully checked for side-effects of leaving the inode value as
zero (yet).  However, it looks so far as its only use is to test to see if
the value changed (meaning that some other process re-wrote the overview
files), except for "inn_msync_page()" -- which might be "simplified"
(sarcastically) by a inode value of zero for any write to a purposely
non-existent overview file.

So, what I'm thinking of is something like:

...
    entry->flag = *flag;
+    if (strchr("ymn", *flag) != NULL) { /* add conditional */
        data=tdx_data_new(group, index->writable);
        if (!tdx_data_open_files(data))
            warn("tradindexed: unable to create data files for %s", group);
        entry->indexinode = data->indexinode;
        tdx_data_close(data);
+    }
    index_add(index, entry);
...

Optionally, we could use this conditional:

+    if (strchr("jx=", *flag) == NULL) {  /* if NOT these */

I guess that depends on what currently "undefined" active-file moderation
flags should do.

Technical Details
Message-ID: <h170rb$uul$1@snarked.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border2.nntp.ams.giganews.com!nntp.giganews.com!feeder.ecngs.de!ecngs!feeder2.ecngs.de!87.106.137.111.MISMATCH!weretis.net!feeder1.news.weretis.net!news.snarked.org!not-for-mail
References: <h16rde$stb$1@snarked.org> <87hbyhx90e.fsf@windlord.stanford.edu>

Show Full Headers
Complete Article Headers
Message-ID: <h170rb$uul$1@snarked.org>
Subject: Re: Q: Regarding overview creation and the active file.
Date: Mon, 15 Jun 2009 19:45:34 -0700
From: "D. Stussy" <spam@bde-arc.ampr.org>
References: <h16rde$stb$1@snarked.org> <87hbyhx90e.fsf@windlord.stanford.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border2.nntp.ams.giganews.com!nntp.giganews.com!feeder.ecngs.de!ecngs!feeder2.ecngs.de!87.106.137.111.MISMATCH!weretis.net!feeder1.news.weretis.net!news.snarked.org!not-for-mail
Newsgroups: news.software.nntp
Lines: 77
Reply-To: "D. Stussy" <replies@newsgroups.kd6lvw.ampr.org>
NNTP-Posting-Host: pool-71-106-211-188.lsanca.dsl-w.verizon.net
X-Trace: snarked.org 1245120171 31701 71.106.211.188 (16 Jun 2009 02:42:51 GMT)
X-Complaints-To: newsmaster@snarked.org
NNTP-Posting-Date: Tue, 16 Jun 2009 02:42:51 +0000 (UTC)
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1478
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1478