🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
8 messages
8 total messages Started by D. Stussy Sun, 04 Oct 2009 21:33
Keeping the history file "small" vs. expire/expireover programs.
#81952
Author: D. Stussy
Date: Sun, 04 Oct 2009 21:33
71 lines
5144 bytes
As noted in a thread earlier this year, I had a problem where the history
index file grew to a size where the system could not regularly run expire.
I think I have figured out a way to have the history file expired while
retaining articles for overview purposes until they naturally expire out of
the spool due to use of a self-expiring storage method.

Given:
 - INN version 2.5.0
 - Storage method CNFS (or any "inexpensive," self-expiring method).
 - Overview method TradIndexed (I haven't looked at the other)
 - Class based expiry (not group based).

Expireover:  Expireover won't need anything special.  As long as the
storage method is not expensive (or "-s" were specified),
storage/tradindexed/tdx-data.c, lines 869-877 imply that messages will be
tested against retrieval via the storage manager but their presence in the
history file will NOT be tested.  Only "expensive" articles when "-s" is
not specified are required to be in the history file in order to be
retained in the overview.  This means that I should be able to remove
articles' history file entries and still have them remain accessible to
readers via the overview files, correct?

I have not investigated whether the storage manager requires that a history
file entry be present for retrieval of an article by SM token, but I don't
believe that it does.


Expire:  The goal appears to be to have the articles expired out of the
history file but not out of the spool.  There may be two ways to perform
this:

1)  Trick the expire program:  By specifying 'news.daily flags="-N -z
/dev/null"', it appears that the expire program will NOT copy expiring
articles into the new history file and will SKIP the removal of the article
from the spool at storage/expire.c, line 538 by by instead writing the list
of articles to expire to the "-z" parameter file.  Since we're not going to
actually remove these articles, routing the output to the "infinite sink
pseudofile" is acceptable.  This method will use the "expire.ctl" file to
limit the number of entries retained in the history file by duration.

2)  Use a front-end program run before expire to limit its size by number
of entries.  In this version, specifying 'news.daily "/usr/bin/tail -n$X
>$TMPHIS" flags="-h $TMPHIS"', where X is the maximum number of entries to
retain from day to day and TMPHIS is some temporary file to hold the
result.  This method will approximately fix the size of the history index
file so it won't grow too big.  With a correct choice of X, considering the
average number of articles arriving daily, the out-of-memory problem should
be avoidable except in extreme cases of rapid article flooding.  This
method won't remove articles from the spool with an appropriate choice in
"expire.ctl" of "never" entries, but the oldest will certainly disappear
from the history file.  Entries removed by the "tail" program will be
retained in the spool


Therefore, am I correct that the above settings will cause the expiration
of articles out of the history file but NOT impact their ability to be
fetched by readers via the overview files until such time that the
self-expiring storage naturally removes them by overwriting?

----------
Also noted:  While investigating this, I noted something unusual with the
"news.daily" script.  Is there unnecessary repeated code present?

Pertaining to running expireover after expire:  Lines 467-484 and lines
487-504 seem to be unnecessary.  Can't they all be removed and simply flow
through to their duplicates at lines 507-523?  The only line not duplicated
in the last block is the "DOEXPIREOVER=false" line which causes the future
instances to be skipped (as there are no future instances for the last
block).  ...Or did I miss something?

Re: Keeping the history file "small" vs. expire/expireover programs.
#81953
Author: Alexander Bartolich
Date: Mon, 05 Oct 2009 05:48
10 lines
1511 bytes
D. Stussy wrote:
> [...]
> I have not investigated whether the storage manager requires that a history
> file entry be present for retrieval of an article by SM token, but I don't
> believe that it does.

Well, I guess that direct retrievel of a message ID works along the
lines of grephistory(1).

-- 
Re: Keeping the history file "small" vs. expire/expireover programs.
#81954
Author: Julien ÉLIE
Date: Mon, 05 Oct 2009 18:08
88 lines
4983 bytes
Hi D. Stussy,

> Also noted:  While investigating this, I noted something unusual with the
> "news.daily" script.  Is there unnecessary repeated code present?
>
> Pertaining to running expireover after expire:  Lines 467-484 and lines
> 487-504 seem to be unnecessary.  Can't they all be removed and simply flow
> through to their duplicates at lines 507-523?  The only line not duplicated
> in the last block is the "DOEXPIREOVER=false" line which causes the future
> instances to be skipped (as there are no future instances for the last
> block).  ...Or did I miss something?

I see that if doexpire is true and doexpireover, dogroupbaseexpiry are false,
we will not run "ctlinnd lowmark" with what you suggest (whereas it was
the case before).
But as "ctlinnd lowmark" is useless without the run of expireover,
I believe we don't care.

Julien


Index: scripts/news.daily.in
===================================================================
--- scripts/news.daily.in       (révision 8646)
+++ scripts/news.daily.in       (copie de travail)
@@ -464,46 +464,10 @@
        if ${DOEXPLOG}; then
            echo "expirerm end `date`" >>${EXPLOG}
        fi
-       ${DOEXPIREOVER} && {
-           if ${DOEXPLOG}; then
-               echo "${EXPIREOVER} start `date`" >>${EXPLOG}
-           fi
-           ( cd ${HISTDIR} ; eval ${EXPIREOVER} "${EXPIREOVERFLAGS}" 2>&1 ) | \
-             grep -v 'No such file or directory'
-           DOEXPIREOVER=false
-           if ${DOEXPLOG}; then
-               echo "${EXPIREOVER} end `date`" >>${EXPLOG}
-           fi
-       }
-       test -n "${LOWMARKFILE}" && {
-           echo "lowmarkrenumber begin `date`: (${LOWMARKFILE})"   >>${EXPLOG}
-           ctlinnd -s -t`wc -l <${ACTIVE}` lowmark ${LOWMARKFILE} 2>&1
-           echo "lowmarkrenumber end `date`"                       >>${EXPLOG}
-           rm -f ${MOST_LOGS}/expire.lastlowmark
-           mv ${LOWMARKFILE} ${MOST_LOGS}/expire.lastlowmark
-       }
     }
-    ##  Expire overview lines for files we just removed.
-    if ${DOEXPIREOVER}; then
-       if ${DOEXPLOG}; then
-           echo "${EXPIREOVER} start `date`" >>${EXPLOG}
-       fi
-       ( cd ${HISTDIR} ; eval ${EXPIREOVER} "${EXPIREOVERFLAGS}" 2>&1 ) | \
-           grep -v 'No such file or directory'
-       DOEXPIREOVER=false
-       if ${DOEXPLOG}; then
-           echo "${EXPIREOVER} end `date`" >>${EXPLOG}
-       fi
-       test -n "${LOWMARKFILE}" && {
-           echo "lowmarkrenumber begin `date`: (${LOWMARKFILE})"   >>${EXPLOG}
-           ctlinnd -s -t`wc -l <${ACTIVE}` lowmark ${LOWMARKFILE} 2>&1
-           echo "lowmarkrenumber end `date`"                       >>${EXPLOG}
-           rm -f ${MOST_LOGS}/expire.lastlowmark
-           mv ${LOWMARKFILE} ${MOST_LOGS}/expire.lastlowmark
-       }
-    fi
 fi
-##  In case noexpire expireover.
+
+##  Remove the articles that are supposed to go from the overview.
 if ${DOEXPIREOVER}; then
     if ${DOEXPLOG}; then
        echo "${EXPIREOVER} start `date`" >>${EXPLOG}
@@ -514,9 +478,9 @@
        echo "${EXPIREOVER} end `date`" >>${EXPLOG}
     fi
     test -n "${LOWMARKFILE}" && {
-       echo "lowmarkrenumber begin `date`: (${LOWMARKFILE})"   >>${EXPLOG}
+       echo "lowmarkrenumber begin `date`: (${LOWMARKFILE})" >>${EXPLOG}
        ctlinnd -s -t`wc -l <${ACTIVE}` lowmark ${LOWMARKFILE} 2>&1
-       echo "lowmarkrenumber end `date`"                           >>${EXPLOG}
+       echo "lowmarkrenumber end `date`" >>${EXPLOG}
        rm -f ${MOST_LOGS}/expire.lastlowmark
        mv ${LOWMARKFILE} ${MOST_LOGS}/expire.lastlowmark
     }

Re: Keeping the history file "small" vs. expire/expireover programs.
#81955
Author: D. Stussy
Date: Mon, 05 Oct 2009 19:56
24 lines
2065 bytes
"Alexander Bartolich" <alexander.bartolich@gmx.at> wrote in message
news:hac1br$3dn$1@news.albasani.net...
> D. Stussy wrote:
> > [...]
> > I have not investigated whether the storage manager requires that a
history
> > file entry be present for retrieval of an article by SM token, but I
don't
> > believe that it does.
>
> Well, I guess that direct retrievel of a message ID works along the
> lines of grephistory(1).

Since the overview files contain the SM token AND the message ID, I don't
see this as a problem.  Using the SM token, the article is retrievable.

Now, this may block a global search by message ID, but it shouldn't prevent
a search by MID where a group the article was posted to is known.  The user
may have to open such a group and search only it.  The reader can use the
overview file to translate the MID to SM token.

Regardless, expireover tests by fetching by SM token, not message ID.

Re: Keeping the history file "small" vs. expire/expireover programs.
#81957
Author: D. Stussy
Date: Mon, 05 Oct 2009 20:37
47 lines
2780 bytes
"Julien ÉLIE" <iulius@nom-de-mon-site.com.invalid> wrote in message
news:hadcms$ng6$1@news.trigofacile.com...
> Hi D. Stussy,
>
> > Also noted:  While investigating this, I noted something unusual with
the
> > "news.daily" script.  Is there unnecessary repeated code present?
> >
> > Pertaining to running expireover after expire:  Lines 467-484 and lines
> > 487-504 seem to be unnecessary.  Can't they all be removed and simply
flow
> > through to their duplicates at lines 507-523?  The only line not
duplicated
> > in the last block is the "DOEXPIREOVER=false" line which causes the
future
> > instances to be skipped (as there are no future instances for the last
> > block).  ...Or did I miss something?
>
> I see that if doexpire is true and doexpireover, dogroupbaseexpiry are
false,
> we will not run "ctlinnd lowmark" with what you suggest (whereas it was
> the case before).
> But as "ctlinnd lowmark" is useless without the run of expireover,
> I believe we don't care.

I take it that by your patch [deleted from this reply], you agreed that the
script code was in fact duplicated.

Perhaps there should be a warning message into the expire log when
"noexpireover lowmark" is used, as lowmark requires expireover.  Something
like:

if [ -n "${LOWMARKFILE}" -a ${DOEXPIREOVER}!= true ] ; then
    echo "lowmark requires expireover" >> ${EXPLOG}
fi

after parameter checking (or optionally combined into the conditional about
line 211):

  test -n "${LOWMARKFILE}"  && {
      EXPIREOVERFLAGS="${EXPIREOVERFLAGS} -Z${LOWMARKFILE}"
+     if [ ${DOEXPIREOVER}!= true ] ; then
+        echo "lowmark requires expireover" >> ${EXPLOG}
+     fi
  }

Re: Keeping the history file "small" vs. expire/expireover programs.
#81956
Author: Julien ÉLIE
Date: Mon, 05 Oct 2009 21:12
28 lines
2187 bytes
Hi D. Stussy,

> Since the overview files contain the SM token AND the message ID, I don't
> see this as a problem.  Using the SM token, the article is retrievable.
>
> Now, this may block a global search by message ID, but it shouldn't prevent
> a search by MID where a group the article was posted to is known.  The user
> may have to open such a group and search only it.  The reader can use the
> overview file to translate the MID to SM token.

But how can it do that with the NNTP protocol?
I understand that a reader can use article numbers in an already selected
newsgroup but ARTICLE/BODY/HEAD/STAT <mid>, HDR Subject <mid> or OVER <mid>
are not supposed to be restricted to a newsgroup.

Anyway, with INN 2.5.1:

OVER <test@mid>
503 Overview by message-ID unsupported

HDR :bytes <test@mid>
503 Metadata requests by message-ID unsupported

-- 
Julien ÉLIE

« Le temps, c'est des sesterces. » (Coquelus)
Re: Keeping the history file "small" vs. expire/expireover programs.
#81958
Author: Julien ÉLIE
Date: Mon, 05 Oct 2009 21:13
24 lines
1898 bytes
Hi D. Stussy,

> I take it that by your patch [deleted from this reply], you agreed that the
> script code was in fact duplicated.

Yep.


> Perhaps there should be a warning message into the expire log when
> "noexpireover lowmark" is used, as lowmark requires expireover.  Something
> like:
>
> if [ -n "${LOWMARKFILE}" -a ${DOEXPIREOVER}!= true ] ; then
>    echo "lowmark requires expireover" >> ${EXPLOG}
> fi

OK.

-- 
Julien ÉLIE

« Pour célébrer ce jour heureux, buvons un coup, buvons-en deux. »
  (Aristophane)
Re: Keeping the history file "small" vs. expire/expireover programs.
#81959
Author: D. Stussy
Date: Mon, 05 Oct 2009 22:56
52 lines
3576 bytes
"Julien ÉLIE" <iulius@nom-de-mon-site.com.invalid> wrote in message
news:hadnfm$4ns$1@news.trigofacile.com...
> > Since the overview files contain the SM token AND the message ID, I
don't
> > see this as a problem.  Using the SM token, the article is retrievable.
> >
> > Now, this may block a global search by message ID, but it shouldn't
prevent
> > a search by MID where a group the article was posted to is known.  The
user
> > may have to open such a group and search only it.  The reader can use
the
> > overview file to translate the MID to SM token.
>
> But how can it do that with the NNTP protocol?
> I understand that a reader can use article numbers in an already selected
> newsgroup but ARTICLE/BODY/HEAD/STAT <mid>, HDR Subject <mid> or OVER
<mid>
> are not supposed to be restricted to a newsgroup.
>
> Anyway, with INN 2.5.1:
>
> OVER <test@mid>
> 503 Overview by message-ID unsupported
>
> HDR :bytes <test@mid>
> 503 Metadata requests by message-ID unsupported

OK, so there is a potential problem here, but that I sidestepped it due to
the fact that INN doesn't support the problem features?

As long as the article is still retrievable somehow when a group is
selected (especially, sequential reading of the group) is what I care
about.  I'm not concerned about features accessing OLDER articles by MID
which would have expired (i.e. no longer in history) but are still in the
spool.  In keeping the size of the history file down, it becomes more like
a "more recently received" list than a complete list of all articles
overviewed.  If the history file were to cover all messages in the spool
plus all remembered rejected messages, that's fine.  However when it can't,
I'd rather have some older messages not accessible by some methods yet
remain accessible by others than to have them expired out before CNFS
auto-purges them.

My current setup has the CNFS buffers holding about 2 years worth of
(text-only) articles, while I have only enough memory to process a history
index file that contains messages of the 6-8 month old vintage (i.e. ~25M
entries).  Hard drive space isn't the issue.  Placing more SDRAM into that
machine isn't possible.  Eventually, I do plan on upgrading the hardware as
it is 2003 vintage, but such won't happen for at least 6 months, so I want
to get by with what I have until then.

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