Thread View: news.software.nntp
7 messages
7 total messages
Started by D. Stussy
Tue, 16 Jun 2009 01:10
Q: Regarding overview creation and the active file.
Author: D. Stussy
Date: Tue, 16 Jun 2009 01:10
Date: Tue, 16 Jun 2009 01:10
22 lines
2128 bytes
2128 bytes
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)?
So, is this the code I need to mess with to prevent empty traditional
overview files from being created for these "non-groups?"
Re: Q: Regarding overview creation and the active file.
Author: Russ Allbery
Date: Tue, 16 Jun 2009 01:28
Date: Tue, 16 Jun 2009 01:28
31 lines
2540 bytes
2540 bytes
"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).
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
Please post questions rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Q: Regarding overview creation and the active file.
Author: D. Stussy
Date: Tue, 16 Jun 2009 02:45
Date: Tue, 16 Jun 2009 02:45
77 lines
4276 bytes
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.
Re: [PATCH] Regarding overview creation and the active file.
Author: D. Stussy
Date: Fri, 19 Jun 2009 11:56
Date: Fri, 19 Jun 2009 11:56
131 lines
6984 bytes
6984 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? ...
>
> 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).
Here's what I have come up with and am running now to test. Bypassing the
creation and leaving the indexinode entry as zero does require bypassing
some log warnings and actually setting the value when a file is finally
allocated (for whatever reason). There seems to be no side effects by
NNRPD as of yet. NNRPD's attempt to read a group won't create overview
files (as expected, but I explicitly checked for this).
I tested this by setting all my "control.*" pseudogroups to "x". Their
index files were not initially created on inn startup. However,
"control.cancel" did have index files appearing once some cancel messages
came in. (I've known that the special files marked with "x" will not block
their special messages filed in them - control messages for "control.*",
any message for junk ("j" marked groups or "wanttrash: true"), or "to
groups => to".) This means no more wasted inodes for blocked, junk, or
aliased groups (2+ per each group).
Of course, servers that are either new or are reinitializing their
tradtional overviews from scratch will benefit. Existing overviews may
not.
No sane filesystem seems to ever return zero for the inode value to an
application program where there's an actual file allocated. The first few
inodes seem to always be reserved for FS special files. (Ext2/3/4 for
Linux seems to reserve the first 8 values. Furthermore, under Unix-type
systems, a inode value of zero in a directory usually means unassigned.)
Should zero turn out to be a problem, then a value of -1 to mean unassigned
shouldn't.
Expireover seems to have created the skipped groups. Argh! Looks like
there's a little more to do.
Patch to date:
DIRECTORY: storage/tradindexed/
diff -u tdx-data.c*
--- tdx-data.c 2009-05-21 20:08:33.000000000 +0000
+++ tdx-data.c.mod 2009-06-19 11:00:14.000000000 +0000
@@ -1055,10 +1055,12 @@
/* Check the inode of the index. */
if (data->indexinode != index->indexinode) {
- warn("tradindexed: index inode mismatch for %s: %lu != %lu",
group,
- (unsigned long) data->indexinode,
- (unsigned long) index->indexinode);
- if (fix) {
+ if (index->indexinode) {
+ warn("tradindexed: index inode mismatch for %s: %lu != %lu",
group,
+ (unsigned long) data->indexinode,
+ (unsigned long) index->indexinode);
+ }
+ if (fix || !index->indexinode) {
index->indexinode = data->indexinode;
changed = true;
}
diff -u tdx-group.c*
--- tdx-group.c 2009-05-21 20:08:33.000000000 +0000
+++ tdx-group.c.mod 2009-06-19 11:05:13.000000000 +0000
@@ -658,10 +658,12 @@
entry->count = 0;
entry->flag = *flag;
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);
+ if (strchr("=xj",*flag) == NULL) {
+ 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);
index_lock(index->fd, INN_LOCK_UNLOCK);
@@ -765,8 +767,10 @@
index_lock_group(index->fd, offset, INN_LOCK_UNLOCK);
goto fail;
}
- if (entry->indexinode != data->indexinode)
- warn("tradindexed: index inode mismatch for %s", group);
+ if (entry->indexinode != data->indexinode) {
+ if (!entry->indexinode) entry->indexinode = data->indexinode;
+ else warn("tradindexed: index inode mismatch for %s", group);
+ }
high = entry->high;
base = entry->base;
index_lock_group(index->fd, offset, INN_LOCK_UNLOCK);
@@ -805,9 +809,11 @@
if (entry->indexinode != data->indexinode) {
if (!tdx_data_open_files(data))
goto fail;
- if (entry->indexinode != data->indexinode)
- warn("tradindexed: index inode mismatch for %s",
+ if (entry->indexinode != data->indexinode) {
+ if (!entry->indexinode) entry->indexinode = data->indexinode;
+ else warn("tradindexed: index inode mismatch for %s",
HashToText(entry->hash));
+ }
data->base = entry->base;
}
Re: [PATCH] Regarding overview creation and the active file.
Author: D. Stussy
Date: Fri, 19 Jun 2009 19:42
Date: Fri, 19 Jun 2009 19:42
89 lines
4413 bytes
4413 bytes
Better patch - found the problem with group expiry creating the skipped
groups. Note the addition of the final section.
DIRECTORY: storage/tradindexed/
diff -u tdx-data.c*
--- tdx-data.c 2009-05-21 20:08:33.000000000 +0000
+++ tdx-data.c.mod 2009-06-19 11:00:14.000000000 +0000
@@ -1055,10 +1055,12 @@
/* Check the inode of the index. */
if (data->indexinode != index->indexinode) {
- warn("tradindexed: index inode mismatch for %s: %lu != %lu",
group,
- (unsigned long) data->indexinode,
- (unsigned long) index->indexinode);
- if (fix) {
+ if (index->indexinode) {
+ warn("tradindexed: index inode mismatch for %s: %lu != %lu",
group,
+ (unsigned long) data->indexinode,
+ (unsigned long) index->indexinode);
+ }
+ if (fix || !index->indexinode) {
index->indexinode = data->indexinode;
changed = true;
}
diff -u tdx-group.c*
--- tdx-group.c 2009-05-21 20:08:33.000000000 +0000
+++ tdx-group.c.mod 2009-06-19 11:05:13.000000000 +0000
@@ -658,10 +658,12 @@
entry->count = 0;
entry->flag = *flag;
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);
+ if (strchr("=xj",*flag) == NULL) {
+ 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);
index_lock(index->fd, INN_LOCK_UNLOCK);
@@ -765,8 +767,10 @@
index_lock_group(index->fd, offset, INN_LOCK_UNLOCK);
goto fail;
}
- if (entry->indexinode != data->indexinode)
- warn("tradindexed: index inode mismatch for %s", group);
+ if (entry->indexinode != data->indexinode) {
+ if (!entry->indexinode) entry->indexinode = data->indexinode;
+ else warn("tradindexed: index inode mismatch for %s", group);
+ }
high = entry->high;
base = entry->base;
index_lock_group(index->fd, offset, INN_LOCK_UNLOCK);
@@ -805,9 +809,11 @@
if (entry->indexinode != data->indexinode) {
if (!tdx_data_open_files(data))
goto fail;
- if (entry->indexinode != data->indexinode)
- warn("tradindexed: index inode mismatch for %s",
+ if (entry->indexinode != data->indexinode) {
+ if (!entry->indexinode) entry->indexinode = data->indexinode;
+ else warn("tradindexed: index inode mismatch for %s",
HashToText(entry->hash));
+ }
data->base = entry->base;
}
@@ -919,6 +925,10 @@
tdx_index_close(index);
return false;
}
+
+ if (!entry->indexinode) return true;
+ /* Since there was no inode for this group, there was nothing to do!
*/
+
tdx_index_rebuild_start(index, entry);
/* tdx_data_expire_start builds the new IDX and DAT files and fills in
the
No Ill Effects - was Re: [PATCH] Regarding overview creation and the active file.
Author: D. Stussy
Date: Tue, 23 Jun 2009 00:05
Date: Tue, 23 Jun 2009 00:05
109 lines
5691 bytes
5691 bytes
"D. Stussy" <spam@bde-arc.ampr.org> wrote in message
news:h1gpnn$eio$1@snarked.org...
> Better patch - found the problem with group expiry creating the skipped
> groups. Note the addition of the final section.
>
> DIRECTORY: storage/tradindexed/
> diff -u tdx-data.c*
> --- tdx-data.c 2009-05-21 20:08:33.000000000 +0000
> +++ tdx-data.c.mod 2009-06-19 11:00:14.000000000 +0000
> @@ -1055,10 +1055,12 @@
>
> /* Check the inode of the index. */
> if (data->indexinode != index->indexinode) {
> - warn("tradindexed: index inode mismatch for %s: %lu != %lu",
> group,
> - (unsigned long) data->indexinode,
> - (unsigned long) index->indexinode);
> - if (fix) {
> + if (index->indexinode) {
> + warn("tradindexed: index inode mismatch for %s: %lu != %lu",
> group,
> + (unsigned long) data->indexinode,
> + (unsigned long) index->indexinode);
> + }
> + if (fix || !index->indexinode) {
> index->indexinode = data->indexinode;
> changed = true;
> }
> diff -u tdx-group.c*
> --- tdx-group.c 2009-05-21 20:08:33.000000000 +0000
> +++ tdx-group.c.mod 2009-06-19 11:05:13.000000000 +0000
> @@ -658,10 +658,12 @@
> entry->count = 0;
> entry->flag = *flag;
> 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);
> + if (strchr("=xj",*flag) == NULL) {
> + 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);
>
> index_lock(index->fd, INN_LOCK_UNLOCK);
> @@ -765,8 +767,10 @@
> index_lock_group(index->fd, offset, INN_LOCK_UNLOCK);
> goto fail;
> }
> - if (entry->indexinode != data->indexinode)
> - warn("tradindexed: index inode mismatch for %s", group);
> + if (entry->indexinode != data->indexinode) {
> + if (!entry->indexinode) entry->indexinode =
data->indexinode;
> + else warn("tradindexed: index inode mismatch for %s",
group);
> + }
> high = entry->high;
> base = entry->base;
> index_lock_group(index->fd, offset, INN_LOCK_UNLOCK);
> @@ -805,9 +809,11 @@
> if (entry->indexinode != data->indexinode) {
> if (!tdx_data_open_files(data))
> goto fail;
> - if (entry->indexinode != data->indexinode)
> - warn("tradindexed: index inode mismatch for %s",
> + if (entry->indexinode != data->indexinode) {
> + if (!entry->indexinode) entry->indexinode =
data->indexinode;
> + else warn("tradindexed: index inode mismatch for %s",
> HashToText(entry->hash));
> + }
> data->base = entry->base;
> }
>
> @@ -919,6 +925,10 @@
> tdx_index_close(index);
> return false;
> }
> +
> + if (!entry->indexinode) return true;
> + /* Since there was no inode for this group, there was nothing to do!
> */
> +
> tdx_index_rebuild_start(index, entry);
>
> /* tdx_data_expire_start builds the new IDX and DAT files and fills
in the
After 5 days of running with this patch, I have noticed no ill effects
whatsoever and it seems to work as expected. Traditional overview files
are not created for "j", "x", or "=" unless they are needed because the
groups are not empty. I have noted no problems with nnrpd either.
Upon review of the code for NNRPD, I note that when it generates a listing
for a user (e.g. "LIST ACTIVE"), alias groups ("=") are excluded and "j"
and "x" groups are returned as if they were actually marked with "n". That
is acceptable in that if groups so marked are not empty, they should be
readable. However, perhaps they should be skipped if they are empty
(lowmark == highmark+1) and not presented as moderation status flagged with
"n"?
Comments?
Re: No Ill Effects - was Re: [PATCH] Regarding overview creation and the active file.
Author: D. Stussy
Date: Sun, 28 Jun 2009 03:40
Date: Sun, 28 Jun 2009 03:40
3 lines
1292 bytes
1292 bytes
No comments on the patch?
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads