Skip to content

Commit

Permalink
Add new ovflushcount parameter in inn.conf
Browse files Browse the repository at this point in the history
The icdsynccount parameter was used for the flushing of both the active
and history files, and buffindexed (though undocumented for that use with
buffindexed).

Add a new parameter for that use.

close #280
  • Loading branch information
Julien-Elie committed Sep 17, 2023
1 parent 544bebd commit c3e5c1c
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 5 deletions.
3 changes: 3 additions & 0 deletions doc/pod/buffindexed.conf.pod
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ method.
You can see the current usage of the buffers with the B<-o> option to
B<inndf>.

The overview data of received articles are flushed to disk every
I<ovflushcount> articles, as set in F<inn.conf>.

In the F<buffindexed.conf> file, blank lines and lines beginning with a
number sign (C<#>) are ignored. All other lines must be of the format:

Expand Down
12 changes: 12 additions & 0 deletions doc/pod/inn.conf.pod
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,18 @@ set to true and the storage method for these newsgroups does not have
self-expire functionality, storing overview data will fail.
The default is unset.

=item I<ovflushcount>

How many articles received between flushing their overview data to disk.
This parameter is only used for the buffindexed overview storage method, and
defaults to C<50>. (Flushing to disk is parameterized differently for other
methods: I<txn_nosync> in F<ovdb.conf>, I<transrowlimit> and I<transtimelimit>
in F<ovsqlite.conf>, and always after each article arrival for tradindexed.)

See I<icdsynccount> (related to flushes of the I<active> and I<history> files)
for more information about this trade-off between faster speed and more data
loss if B<innd> crashes.

=item I<ovmethod>

Which overview storage method to use. Currently supported values are
Expand Down
7 changes: 7 additions & 0 deletions doc/pod/news.pod
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ NoCeM issuers, and make sure the right PGP keys are present on your system.

=item *

Added a new I<ovflushcount> parameter in F<inn.conf>, defaulting to C<50>, to
parameterize the number of articles received between flushing their overview
data to disk, when using the buffindexed overview storage method. (In
previous releases, that number was ten times the value of I<icdsynccount>.)

=item *

B<innreport> now supports high-precision timestamps like
C<2023-07-29T04:15:01.889064+02:00> that syslog can be parameterized to use;
daily Usenet reports otherwise indicated all these logs as unknown entries,
Expand Down
1 change: 1 addition & 0 deletions include/inn/innconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ struct innconf {
bool mergetogroups; /* Refile articles from to.* into to */
bool nfswriter; /* Use NFS writer functionality */
unsigned long overcachesize; /* fd size cache for tradindexed */
unsigned long ovflushcount; /* Articles between buffindexed flushes */
char *ovgrouppat; /* Newsgroups to store overview for */
char *ovmethod; /* Which overview method to use */
bool storeonxref; /* SMstore use Xref to detemine class? */
Expand Down
1 change: 1 addition & 0 deletions lib/innconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ static const struct config config_table[] = {
{K(nfswriter), BOOL(false) },
{K(nnrpdcheckart), BOOL(true) },
{K(overcachesize), UNUMBER(128) },
{K(ovflushcount), UNUMBER(50) },
{K(ovgrouppat), STRING(NULL) },
{K(storeonxref), BOOL(true) },
{K(tradindexedmmap), BOOL(true) },
Expand Down
1 change: 1 addition & 0 deletions samples/inn.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ groupbaseexpiry: true
mergetogroups: false
nfswriter: false
overcachesize: 128
ovflushcount: 50
#ovgrouppat:
storeonxref: true
useoverchan: false
Expand Down
3 changes: 2 additions & 1 deletion storage/buffindexed/buffindexed.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
** do file write for each update. Instead we'll do it at every
** OVBUFF_SYNC_COUNT updates.
*/
#define OVBUFF_SYNC_COUNT (innconf->icdsynccount * 10 + 1)
#define OVBUFF_SYNC_COUNT (innconf->ovflushcount)

/* ovbuff header */
#define OVBUFFMASIZ 8
Expand Down Expand Up @@ -763,6 +763,7 @@ ovbuffinit_disks(void)
ovbuff->usedblk = 0;
ovbuff->freeblk = 0;
ovbuff->updated = 0;
/* Force a flush. */
ovbuff->dirty = OVBUFF_SYNC_COUNT + 1;
notice("buffindexed: no magic cookie found for ovbuff %d, "
"initializing",
Expand Down
5 changes: 2 additions & 3 deletions tests/overview/api-t.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ group_del(void *entry)

/* Build a stripped-down innconf struct that contains only those settings that
the overview backend cares about. (May still be missing additional bits
for ovdb.)
innconf->icdsynccount defines OVBUFF_SYNC_COUNT. */
for ovdb.) */
static void
fake_innconf(void)
{
Expand All @@ -76,10 +75,10 @@ fake_innconf(void)
memset(innconf, 0, sizeof(*innconf));
innconf->enableoverview = true;
innconf->groupbaseexpiry = true;
innconf->icdsynccount = 10;
innconf->keepmmappedthreshold = 1024;
innconf->nfsreader = false;
innconf->overcachesize = 20;
innconf->ovflushcount = 50;
innconf->ovgrouppat = NULL;
innconf->pathdb = xstrdup("ov-tmp");
innconf->pathetc = xstrdup("etc");
Expand Down
2 changes: 1 addition & 1 deletion tests/overview/overview-t.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ fake_innconf(void)
memset(innconf, 0, sizeof(*innconf));
innconf->enableoverview = true;
innconf->groupbaseexpiry = true;
innconf->icdsynccount = 10;
innconf->keepmmappedthreshold = 1024;
innconf->nfsreader = false;
innconf->overcachesize = 20;
innconf->ovflushcount = 50;
innconf->ovgrouppat = NULL;
innconf->ovmethod = xstrdup(STRING(OVTYPE));
innconf->pathdb = xstrdup("ov-tmp");
Expand Down

0 comments on commit c3e5c1c

Please sign in to comment.