🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
14 messages
14 total messages Started by Christian Kratzer Mon, 10 Oct 2005 08:00
Rebuilding overview for single group ?
#72438
Author: Christian Kratzer
Date: Mon, 10 Oct 2005 08:00
27 lines
1990 bytes
Hi,

we have a situation with inn 2.4.1 a couple of groups where the IDX file 
of the overview has exploded to a huge size.  Is there any way we could
just rebuild the IDX file from the DAT file.

expireover is already unable to mmap the IDX file.

  news@news: {105} ll control.cancel.*
  -rw-rw-r--  1 news  news   203287956 Oct 10 09:52 control.cancel.DAT
  -rw-rw-r--  1 news  news  2031908920 Oct 10 09:52 control.cancel.IDX
  news@news: {106} 

we have a separate 1 GIG cnfs buffer for control which is obviously
massively oversized.  

I will propably drop and reacrea the control groups with a smaller
cnfs buffer to fix this one but I also have other groups with oversized
IDX files that I might want to fix before they explode.

Greetings
Christian

-- 
Christian Kratzer                       ck+usenet@cksoft.de
CK Software GmbH                        http://www.cksoft.de/
Phone: +49 7452 889 135                 Fax: +49 7452 889 136
Re: Rebuilding overview for single group ?
#72440
Author: Jeffrey M. Vinocur
Date: Mon, 10 Oct 2005 11:09
14 lines
1545 bytes
In article <did720$lvl$1@news.germany.com>,
Christian Kratzer  <ck+usenet@cksoft.de> wrote:
>
>we have a situation with inn 2.4.1 a couple of groups where the IDX file 
>of the overview has exploded to a huge size.  Is there any way we could
>just rebuild the IDX file from the DAT file.

For groups that are stored in tradspool, you can use tdx-util to
do this.  I don't know any way to do so with CNFS (short of
converting the group to tradspool in some fashion).

-- 
Jeffrey M. Vinocur
jeff@litech.org
Re: Rebuilding overview for single group ?
#72442
Author: Russ Allbery
Date: Mon, 10 Oct 2005 20:19
27 lines
2207 bytes
Christian Kratzer <ck+usenet@cksoft.de> writes:

> we have a situation with inn 2.4.1 a couple of groups where the IDX file
> of the overview has exploded to a huge size.  Is there any way we could
> just rebuild the IDX file from the DAT file.

Unfortunately, there is information in the IDX file that is not in the DAT
file.  The DAT file contains only the information sent to clients on XOVER
commands, and the IDX file contains the additional meta-information used
by INN (article token, arrival time, that sort of thing).

> expireover is already unable to mmap the IDX file.

>   news@news: {105} ll control.cancel.*
>   -rw-rw-r--  1 news  news   203287956 Oct 10 09:52 control.cancel.DAT
>   -rw-rw-r--  1 news  news  2031908920 Oct 10 09:52 control.cancel.IDX
>   news@news: {106} 

For control.cancel, I'd just not allow clients to read the group.  It's
not particularly useful for them to do so.  That doesn't help for the
other groups, though.

-- 
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: Rebuilding overview for single group ?
#72444
Author: Bill Davidsen
Date: Mon, 10 Oct 2005 20:21
33 lines
2977 bytes
Jeffrey M. Vinocur wrote:
> In article <did720$lvl$1@news.germany.com>,
> Christian Kratzer  <ck+usenet@cksoft.de> wrote:
> 
>>we have a situation with inn 2.4.1 a couple of groups where the IDX file 
>>of the overview has exploded to a huge size.  Is there any way we could
>>just rebuild the IDX file from the DAT file.
> 
> 
> For groups that are stored in tradspool, you can use tdx-util to
> do this.  I don't know any way to do so with CNFS (short of
> converting the group to tradspool in some fashion).
> 
I had that problem and was able to expireover on the single group 
although it failed during daily. I made no attempt to discover why, I 
was busy ;-) It is possible that the ulimit settings are not the same 
for cron and the news user. Clearly that's thing one to try.

However, there are several things I was going to try next. All assume 
that the data in the file is valid, just too large to process, none were 
tried.

One thing to try would be to turn off mmap in inn.conf and let the 
expireover do things the hard way. Another would be to save and delete 
the files, and go through the DAT file identifying the articles still on 
the server and grabbing enough information to pipe back into overchan, 
so it can rebuild a correct overview. Sounds like a trivial perl program 
could do it.

-- 
bill davidsen
   SBC/Prodigy Yorktown Heights NY data center
   http://newsgroups.news.prodigy.com
Re: Rebuilding overview for single group ?
#72447
Author: Christian Kratzer
Date: Thu, 13 Oct 2005 08:12
65 lines
3844 bytes
Hi,

Russ Allbery <rra@stanford.edu> wrote:
> Christian Kratzer <ck+usenet@cksoft.de> writes:
> 
>> we have a situation with inn 2.4.1 a couple of groups where the IDX file
>> of the overview has exploded to a huge size.  Is there any way we could
>> just rebuild the IDX file from the DAT file.
> 
> Unfortunately, there is information in the IDX file that is not in the DAT
> file.  The DAT file contains only the information sent to clients on XOVER
> commands, and the IDX file contains the additional meta-information used
> by INN (article token, arrival time, that sort of thing).

thanks for clarification. I thought there was something like that.

I managed to further trace the cause of our problem yesterday.  
We have some peers that send us multiple (more than 3) xref headers from which 
inn only seeems to strip the first one.  These foreing xref headers have
huge article numbers in relation to ours.

This was not yet a problem but we had some filesystem trouble lately
that killed us some overview files. We subsequently rebuild all of 
overview from spool using makehistory.

It seems that while rebuilding history the other servers xref headers 
also got evaluated and we had an explosion in article numbers.  

Our DAT files now contain overview for articles numbers in the range of our
active file only.  The IDX files contain a huge gap and and then the other
servers numbers.  This is why some of our IDX files are huge in relation
to the DAT files.

>> expireover is already unable to mmap the IDX file.
> 
>>   news@news: {105} ll control.cancel.*
>>   -rw-rw-r--  1 news  news   203287956 Oct 10 09:52 control.cancel.DAT
>>   -rw-rw-r--  1 news  news  2031908920 Oct 10 09:52 control.cancel.IDX
>>   news@news: {106} 
> 
> For control.cancel, I'd just not allow clients to read the group.  It's
> not particularly useful for them to do so.  That doesn't help for the
> other groups, though.

We seem to have several options now:

1.  rebuild overview from spool once more after hacking inn to only 
    respect our own overview records.     Else the problem would just
    repeat itself again.

2.  hack up something to truncate and fix the IDX files.  
    Not too comfortable with this option though.

3.  Do something to filter away forein xref headers in the future.

I think we will go for option 1 after I find the correct place to hack
in inn.

Greetings
Christian

-- 
Christian Kratzer                       ck+usenet@cksoft.de
CK Software GmbH                        http://www.cksoft.de/
Phone: +49 7452 889 135                 Fax: +49 7452 889 136
Re: Rebuilding overview for single group ?
#72448
Author: Russ Allbery
Date: Thu, 13 Oct 2005 16:50
28 lines
2212 bytes
Christian Kratzer <ck+usenet@cksoft.de> writes:

> I managed to further trace the cause of our problem yesterday.  We have
> some peers that send us multiple (more than 3) xref headers from which
> inn only seeems to strip the first one.  These foreing xref headers have
> huge article numbers in relation to ours.

Yeah.  :/  This is now fixed in STABLE.  I was hoping to get a new release
out before I went on vacation, but I ran out of time.  Expect a new
release in early November.

> 1.  rebuild overview from spool once more after hacking inn to only 
>     respect our own overview records.     Else the problem would just
>     repeat itself again.

This is probably the best option for right now.

> I think we will go for option 1 after I find the correct place to hack
> in inn.

expire/makehistory.c and innd/art.c are the easiest places to make this
change.

-- 
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: Rebuilding overview for single group ?
#72449
Author: Christian Kratzer
Date: Thu, 13 Oct 2005 18:56
38 lines
2563 bytes
Hi,

Russ Allbery <rra@stanford.edu> wrote:
> Christian Kratzer <ck+usenet@cksoft.de> writes:
> 
>> I managed to further trace the cause of our problem yesterday.  We have
>> some peers that send us multiple (more than 3) xref headers from which
>> inn only seeems to strip the first one.  These foreing xref headers have
>> huge article numbers in relation to ours.
> 
> Yeah.  :/  This is now fixed in STABLE.  I was hoping to get a new release
> out before I went on vacation, but I ran out of time.  Expect a new
> release in early November.
> 
>> 1.  rebuild overview from spool once more after hacking inn to only 
>>     respect our own overview records.     Else the problem would just
>>     repeat itself again.
> 
> This is probably the best option for right now.
> 
>> I think we will go for option 1 after I find the correct place to hack
>> in inn.
> 
> expire/makehistory.c and innd/art.c are the easiest places to make this
> change.

thanks for the feedback.  makehistory.c is what I was planning on going for
after spending some time in the source today.   

Do you have any details how the xref duplication was fixed in stable ?

Greetings
Christian

-- 
Christian Kratzer                       ck+usenet@cksoft.de
CK Software GmbH                        http://www.cksoft.de/
Phone: +49 7452 889 135                 Fax: +49 7452 889 136
Re: Rebuilding overview for single group ?
#72450
Author: Russ Allbery
Date: Fri, 14 Oct 2005 03:17
53 lines
2656 bytes
Christian Kratzer <ck+usenet@cksoft.de> writes:

> Do you have any details how the xref duplication was fixed in stable ?

Index: innd/art.c
===================================================================
--- art.c	(revision 7237)
+++ art.c	(working copy)
@@ -631,7 +631,7 @@
   if (i == HDR__BYTES)
     cp->Data.BytesHeader = header;
   hc = &hc[i];
-  if (hc->Length > 0) {
+  if (hc->Length != 0) {
     /* duplicated */
     hc->Length = -1;
   } else {
@@ -1019,12 +1019,17 @@
   /* Make sure all the headers we need are there */
   for (i = 0; i < MAX_ARTHEADER ; i++) {
     if (hp[i].Type == HTreq) {
-      if (!HDR_FOUND(i)) {
+      if (HDR_FOUND(i))
+        continue;
+      if (hc[i].Length < 0) {
+        sprintf(buff, "%d Duplicate \"%s\" header", NNTP_REJECTIT_VAL,
+                hp[1].Name);
+      } else {
 	sprintf(buff, "%d Missing \"%s\" header", NNTP_REJECTIT_VAL,
-	  hp[i].Name);
-	TMRstop(TMR_ARTCLEAN);
-	return false;
+                hp[i].Name);
       }
+      TMRstop(TMR_ARTCLEAN);
+      return false;
     }
   }
 
@@ -1525,6 +1530,7 @@
     GroupPointers[i++] = ngp;
     nogroup = false;
   }
+  GroupPointers[i] = NULL;
   if (nogroup)
     return false;
   return true;

-- 
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: Rebuilding overview for single group ?
#72452
Author: Christian Kratzer
Date: Mon, 17 Oct 2005 06:57
65 lines
3828 bytes
Hi,

Russ Allbery <rra@stanford.edu> wrote:
[snipp]
> expire/makehistory.c and innd/art.c are the easiest places to make this
> change.

I hacked up a quick fix to expire/makehistory.c from inn-2.4.2 over the
weekend and used it to fix our overview corruption

--- makehistory.c.orig  Wed Dec 22 05:21:19 2004
+++ makehistory.c       Mon Oct 17 08:50:09 2005
@@ -507,6 +507,7 @@
     char                       overdata[BIG_BUFFER];
     char                       bytes[BIG_BUFFER];
     struct artngnum            ann;
+    char                       temp[SMBUF];

     /* Set up place to store headers. */
     for (fp = ARTfields, i = 0; i < ARTfieldsize; i++, fp++) {
@@ -526,7 +527,22 @@
        }
     }
     for (fp = ARTfields, i = 0; i < ARTfieldsize; i++, fp++) {
-        fp->Header = wire_findheader(art->data, art->len, fp->Headername);
+       p = wire_findheader(art->data, art->len, fp->Headername);
+       if(fp == Xrefp) {
+               /* ignore non local xref headers */
+               while(p && strncmp(innconf->pathhost,p,strlen(innconf->pathhost))) {
+                       q = wire_endheader(p, art->data + art->len - 1);
+                       len = (q-p)<sizeof(temp)-1 ? (q-p) : sizeof(temp)-1;
+                       strncpy(temp,p,len);
+                       if(len>2) temp[len-3]=0;
+                       warn("ignoring non local xref header %s in %s",temp,TokenToText(*art->token));
+                       if(q)
+                               p = wire_findheader(q, art->len-(q-art->data), fp->Headername);
+                       else
+                               p = q;
+               }
+       }
+       fp->Header = p;
         if (fp->Header != NULL) {
            fp->HasHeader = true;
             p = wire_endheader(fp->Header, art->data + art->len - 1);

the patch searches the article for xref headers until it finds one thats
begin matches innconf->pathhost.  

If you want to include this patch in future inns I can also email it as
an attachment.   Might be a good idea as lots of people will have their
spools polluted with stuff like this:

	Message-ID: <3inbh1lj9pcl6pdl9vgam1c31onp8996k5@4ax.com>
	X-Comments:  This message was posted through Newsfeeds.com
	Xref: spool6-east.superfeed.net comp.dcom.sys.cisco:273778
	Xref: spool6-east.superfeed.net comp.dcom.sys.cisco:273778
	Xref: ahven.cksoft.de comp.dcom.sys.cisco:5731

Greetings
Christian

-- 
Christian Kratzer                       ck+usenet@cksoft.de
CK Software GmbH                        http://www.cksoft.de/
Phone: +49 7452 889 135                 Fax: +49 7452 889 136
Re: Rebuilding overview for single group ?
#72453
Author: Christian Kratzer
Date: Mon, 17 Oct 2005 07:02
72 lines
3396 bytes
Hi,

Russ Allbery <rra@stanford.edu> wrote:
> Christian Kratzer <ck+usenet@cksoft.de> writes:
> 
>> Do you have any details how the xref duplication was fixed in stable ?
> 
> Index: innd/art.c
> ===================================================================
> --- art.c       (revision 7237)
> +++ art.c       (working copy)
> @@ -631,7 +631,7 @@
>   if (i == HDR__BYTES)
>     cp->Data.BytesHeader = header;
>   hc = &hc[i];
> -  if (hc->Length > 0) {
> +  if (hc->Length != 0) {
>     /* duplicated */
>     hc->Length = -1;
>   } else {
> @@ -1019,12 +1019,17 @@
>   /* Make sure all the headers we need are there */
>   for (i = 0; i < MAX_ARTHEADER ; i++) {
>     if (hp[i].Type == HTreq) {
> -      if (!HDR_FOUND(i)) {
> +      if (HDR_FOUND(i))
> +        continue;
> +      if (hc[i].Length < 0) {
> +        sprintf(buff, "%d Duplicate \"%s\" header", NNTP_REJECTIT_VAL,
> +                hp[1].Name);
> +      } else {
>        sprintf(buff, "%d Missing \"%s\" header", NNTP_REJECTIT_VAL,
> -         hp[i].Name);
> -       TMRstop(TMR_ARTCLEAN);
> -       return false;
> +                hp[i].Name);
>       }
> +      TMRstop(TMR_ARTCLEAN);
> +      return false;
>     }
>   }
> 
> @@ -1525,6 +1530,7 @@
>     GroupPointers[i++] = ngp;
>     nogroup = false;
>   }
> +  GroupPointers[i] = NULL;
>   if (nogroup)
>     return false;
>   return true;
> 

>From a quick look this looks to me as articles with multiple xref 
headers would be rejected and the articles message-id subsequently
recorded in history.

I am concerned that this would lead to clean versions of the article 
reaching the server through other paths also being rejected.

If above analysis is correct I would propably prefer stripping all 
xref headers from the article.  Might be a bit more complicated to
do in the current code though.

Comments ?

Greetings
Christian

-- 
Christian Kratzer                       ck+usenet@cksoft.de
CK Software GmbH                        http://www.cksoft.de/
Phone: +49 7452 889 135                 Fax: +49 7452 889 136
Re: Rebuilding overview for single group ?
#72552
Author: Russ Allbery
Date: Wed, 02 Nov 2005 04:22
28 lines
2510 bytes
Christian Kratzer <ck+usenet@cksoft.de> writes:

> From a quick look this looks to me as articles with multiple xref 
> headers would be rejected and the articles message-id subsequently
> recorded in history.

> I am concerned that this would lead to clean versions of the article 
> reaching the server through other paths also being rejected.

Do you believe that the duplicate Xref header problem is path-dependent?
That doesn't fit the articles that I've seen; all the ones I've seen had
two Xref headers added by the original injecting institution and would
therefore be bogus via any path.

> If above analysis is correct I would propably prefer stripping all 
> xref headers from the article.  Might be a bit more complicated to
> do in the current code though.

Stripping additional headers in innd is hideously difficult to do due to
the way that innd is structured for performance reasons, not to mention
that none of the internal data structures handle tracking multiple offsets
for the same header.

-- 
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: Rebuilding overview for single group ?
#72556
Author: Christian Kratzer
Date: Wed, 02 Nov 2005 12:11
55 lines
3497 bytes
Hi,

Russ Allbery <rra@stanford.edu> wrote:
> Christian Kratzer <ck+usenet@cksoft.de> writes:
> 
>> From a quick look this looks to me as articles with multiple xref 
>> headers would be rejected and the articles message-id subsequently
>> recorded in history.
> 
>> I am concerned that this would lead to clean versions of the article 
>> reaching the server through other paths also being rejected.
> 
> Do you believe that the duplicate Xref header problem is path-dependent?
> That doesn't fit the articles that I've seen; all the ones I've seen had
> two Xref headers added by the original injecting institution and would
> therefore be bogus via any path.

I am not quite sure what caused the problem. I was in contact with 
the peer that kept feexding us those articles and they fixed the problem.

They said it was a configuration problem but would not elaborate any
further on the exact cause. 

I am not sure what they are running but it isn't inn.

I fetched all the articles from our spool and fetched a couple from
other peers.  They did not have the duplicated xrefs. Could be because
other news software strips them.

I have more details and logs. If you are interested contact me
outside of news.

>> If above analysis is correct I would propably prefer stripping all 
>> xref headers from the article.  Might be a bit more complicated to
>> do in the current code though.
> 
> Stripping additional headers in innd is hideously difficult to do due to
> the way that innd is structured for performance reasons, not to mention
> that none of the internal data structures handle tracking multiple offsets
> for the same header.

Yes I can sympathize with that. Would propably need a rewrite.

What do you think of adding protection to makehistory like in the patch
I posted. I personally will require the patch in our makehistory at least
until the bogus articles have expired from our spool which will take some 
time.

Greetings
Christian

-- 
Christian Kratzer                       ck+usenet@cksoft.de
CK Software GmbH                        http://www.cksoft.de/
Phone: +49 7452 889 135                 Fax: +49 7452 889 136
Re: Rebuilding overview for single group ?
#72818
Author: Russ Allbery
Date: Mon, 12 Dec 2005 03:24
18 lines
1986 bytes
Christian Kratzer <ck+usenet@cksoft.de> writes:

> the patch searches the article for xref headers until it finds one thats
> begin matches innconf->pathhost.  

I thought about this for a while and decided this wasn't the best approach
since it would have to be optional (a lot of people still have old
articles around from an earlier host) and it's not clear when to use it.

Instead, I added a patch to makehistory that checks to see if there are
multiple Xref headers and, if so, only uses the last one.  I believe that
will always do the right thing in this case.

-- 
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: Rebuilding overview for single group ?
#72819
Author: Christian Kratzer
Date: Mon, 12 Dec 2005 14:48
26 lines
2215 bytes
Hi,

Russ Allbery <rra@stanford.edu> wrote:
> Christian Kratzer <ck+usenet@cksoft.de> writes:
> 
>> the patch searches the article for xref headers until it finds one thats
>> begin matches innconf->pathhost.  
> 
> I thought about this for a while and decided this wasn't the best approach
> since it would have to be optional (a lot of people still have old
> articles around from an earlier host) and it's not clear when to use it.
> 
> Instead, I added a patch to makehistory that checks to see if there are
> multiple Xref headers and, if so, only uses the last one.  I believe that
> will always do the right thing in this case.

in that case the last one is propably the better option. Thanks for taking
the time to review the patch.

Greetings
Christian

-- 
Christian Kratzer                       ck+usenet@cksoft.de
CK Software GmbH                        http://www.cksoft.de/
Phone: +49 7452 889 135                 Fax: +49 7452 889 136
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