INN commit: branches/2.6 (7 files)

INN Commit rra at isc.org
Sun Feb 4 15:38:19 UTC 2018


    Date: Sunday, February 4, 2018 @ 07:38:19
  Author: iulius
Revision: 10241

ovdb:  improve documentation, and change the default value for readserver to true

Using ovdb_server helper server helps improve the stability of the ovdb
overview method, so sets the default value for readserver in ovdb.conf
to true.

Also greatly improve the documentation for ovdb:  better POD formatting,
describe what are the 3 possible versions of ovdb, clarify what
is an upgrade, document the ncache parameter (it was absent from
documentation), remove old wording for nocompact, remove duplicate
explanation of ovdb_init tasks in ovdb(5), mention that rc.news takes
care of stopping ovdb_monitor, add the -M option to ovdb_stat synopsis,
improve ovdb.conf sample file (better wording, and consistent with the
man page).

Modified:
  branches/2.6/doc/pod/news.pod
  branches/2.6/doc/pod/ovdb.pod
  branches/2.6/doc/pod/ovdb_init.pod
  branches/2.6/doc/pod/ovdb_monitor.pod
  branches/2.6/doc/pod/ovdb_stat.pod
  branches/2.6/samples/ovdb.conf
  branches/2.6/storage/ovdb/ovdb.c

--------------------------+
 doc/pod/news.pod         |    8 
 doc/pod/ovdb.pod         |  362 +++++++++++++++++++++++----------------------
 doc/pod/ovdb_init.pod    |   56 +++---
 doc/pod/ovdb_monitor.pod |   28 +--
 doc/pod/ovdb_stat.pod    |   44 ++---
 samples/ovdb.conf        |   50 +++---
 storage/ovdb/ovdb.c      |    2 
 7 files changed, 300 insertions(+), 250 deletions(-)

Modified: doc/pod/news.pod
===================================================================
--- doc/pod/news.pod	2018-02-04 15:34:12 UTC (rev 10240)
+++ doc/pod/news.pod	2018-02-04 15:38:19 UTC (rev 10241)
@@ -17,6 +17,14 @@
 
 =item *
 
+Use of the B<ovdb_server> helper server is now the default when
+using the ovdb overview method, that is to say the default value
+for the I<readserver> parameter in F<ovdb.conf> is now set to true.
+It improves stability and avoids deadlocks, timing issues and corrupted
+ovdb databases.
+
+=item *
+
 B<mailpost> now removes empty header fields before attempting to post
 articles, and keeps trace of them in the X-Mailpost-Empty-Hdrs: newly
 generated header field body.  Also, B<mailpost> now sanitizes header

Modified: doc/pod/ovdb.pod
===================================================================
--- doc/pod/ovdb.pod	2018-02-04 15:34:12 UTC (rev 10240)
+++ doc/pod/ovdb.pod	2018-02-04 15:38:19 UTC (rev 10241)
@@ -4,29 +4,53 @@
 
 =head1 DESCRIPTION
 
-Ovdb is a storage method that uses the S<Berkeley DB> library to store
-overview data.  It requires version 4.4 or later of the S<Berkeley DB>
-library (4.7+ is recommended because older versions suffer from various
-issues).
+The ovdb overview is a storage method that uses the S<Berkeley DB>
+library to store overview data.  It requires version 4.4 or later of
+the S<Berkeley DB> library (4.7+ is recommended because older versions
+suffer from various issues).
 
-Ovdb makes use of the full transaction/logging/locking functionality of
-the S<Berkeley DB> environment.  S<Berkeley DB> may be downloaded from
+The ovdb overview method makes use of the full
+transaction/logging/locking functionality of the
+S<Berkeley DB> environment.  S<Berkeley DB> may be downloaded from
 L<http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html>
 and is needed to build the ovdb backend.
 
 =head1 UPGRADING
 
-This is version 2 of ovdb.  If you have a database created with a previous
-version of ovdb (such as the one shipped with S<INN 2.3.0>) your database
-will need to be upgraded using ovdb_init(8).  See the man page
-ovdb_init(8) for upgrade instructions.
+There are several versions of the ovdb storage method:
 
+=over 2
+
+=item *
+
+Version 1, the initial version shipped with S<INN 2.3.0> up to S<INN 2.3.5>.
+
+=item *
+
+Version 2, with improved performance, since S<INN 2.4.0>.
+
+=item *
+
+Version 3, corresponding to version 2 with compression enabled, starting
+with S<INN 2.5.0>.
+
+=back
+
+If you have a database created with a previous version of ovdb,
+your database will need to be upgraded using B<ovdb_init>.  See the
+ovdb_init(8) man page for upgrade instructions, as well as the
+L<COMPRESSION> section below.
+
+Note that when the S<Berkeley DB> library is updated to a newer version,
+the ovdb database also needs being upgraded.
+
 =head1 INSTALLATION
 
-To build ovdb support into INN, specify the option B<--with-bdb>
-when running the configure script.  By default, configure will search
-for S<Berkeley DB> in default search paths; there will be a message in
-the configure output indicating the pathname that will be used.
+If the S<Berkeley DB> library is found at configure time, INN will be
+built with S<Berkeley DB> support unless the B<--without-bdb> flag is
+explicitly passed to configure.  By default, configure will search for
+S<Berkeley DB> in standard locations; there will be a message in the
+configure output indicating the pathname that will be used.
 
 You can override this pathname by adding a path to the option, for
 instance B<--with-bdb=/usr/BerkeleyDB.4.4>.  This directory
@@ -36,58 +60,66 @@
 libraries are used, one or both of the options B<--with-bdb-include>
 and B<--with-bdb-lib> can be given to configure with a path.
 
-The ovdb database may take up more disk space for a given spool than the
-other overview methods.  Plan on needing at least S<1.1 KB> for every article
-in your spool (not counting crossposts).  So, if you have 5 million
-articles, you'll need at least S<5.5 GB> of disk space for ovdb. With compression
-enabled, this estimate changes to S<0.7 KB> per article.  See the L<COMPRESSION>
-section below.
-Plus, you'll need additional space for transaction logs: at least S<100 MB>.
-By default the transaction logs go in the same directory as the database.
-To improve performance, they can be placed on a different disk S<-- see>
-the L<DB_CONFIG> section.
+The ovdb database may take up more disk space for a given spool
+than the other overview methods.  Plan on needing at least S<1.1 KB>
+for every article in your spool (not counting crossposts).  So, if
+you have 5 million articles, you'll need at least S<5.5 GB> of disk
+space for ovdb.  With compression enabled, this estimate changes to
+S<0.7 KB> per article.  See the L<COMPRESSION> section below.  Plus,
+you'll need additional space for transaction logs: at least S<100 MB>.
+By default, the transaction logs go in the same directory as the database.
+To improve performance, they can be placed on a different disk S<--
+see> the L<DB_CONFIG> section.
 
 =head1 CONFIGURATION
 
-To enable ovdb, set the I<ovmethod> parameter in F<inn.conf> to C<ovdb>.
-The ovdb database is stored in the directory specified by the
-I<pathoverview> parameter in F<inn.conf>.  This is the "DB_HOME" directory.
-To start out, this directory should be empty (other than an optional
-F<DB_CONFIG> file; see L<DB_CONFIG> for details) and B<innd> (or
-B<makehistory>) will create the files as necessary in that directory.
-Make sure the directory is owned by the news user.
+To enable the ovdb overview method, set the I<ovmethod> parameter in
+F<inn.conf> to C<ovdb>.  The ovdb database is stored in the directory
+specified by the I<pathoverview> parameter in F<inn.conf>.  This is
+the C<DB_HOME> directory.  To start out, this directory should be empty
+(other than an optional F<DB_CONFIG> file; see L<DB_CONFIG> for details),
+and B<innd> (or B<makehistory>) will create the files as necessary in
+that directory.  Also, make sure the directory is owned by the news user.
 
-Other parameters for configuring ovdb are in the ovdb.conf(5)
-configuration file.  See also the sample F<ovdb.conf>.
+Other parameters for configuring ovdb are in the F<ovdb.conf>
+configuration file.  The following parameters can be set in that file:
 
 =over 4
 
-=item cachesize
+=item I<compress>
 
+If INN was compiled with zlib, and this I<compress> parameter is true,
+ovdb will compress overview records that are longer than 600 bytes.
+See the L<COMPRESSION> section below.
+
+=item I<cachesize>
+
 Size of the memory pool cache, in kilobytes.  The cache will have a
-backing store file in the DB directory which will be at least as big.  In
-general, the bigger the cache, the better.  Use C<ovdb_stat -m> to see
-cache hit percentages.  To make a change of this parameter take effect,
-shut down and restart INN (be sure to kill all of the nnrpds when shutting
-down).  Default is 8000, which is adequate for small to medium sized
-servers.  Large servers will probably need at least 20000.
+backing store file in the DB directory which will be at least as big.
+In general, the bigger the cache, the better.  Use C<ovdb_stat -m>
+to see cache hit percentages.  To make a change of this parameter take
+effect, shut down and restart INN (be sure to kill all of the B<nnrpd>
+processes when shutting down).  Default is C<8000> (KB), which is adequate
+for small to medium-sized servers.  Large servers will probably need
+at least C<20000> (KB).
 
-=item compress
+=item I<ncache>
 
-If INN was compiled with zlib, and this compress parameter is true, OVDB
-will compress overview records that are longer than 600 bytes. See
-the L<COMPRESSION> section below.
+Number of regions across which to split the cache.  The region size
+is equal to I<cachesize> divided by I<ncache>.  Default is C<1> for
+I<ncache>, that is to say the cache will be allocated contiguously
+in memory.
 
-=item numdbfiles
+=item I<numdbfiles>
 
 Overview data is split between this many files.  Currently, B<innd> will
 keep all of the files open, so don't set this too high or B<innd> may run
 out of file descriptors.  B<nnrpd> only opens one at a time, regardless.
 May be set to one, or just a few, but only do that if your OS supports
-large (>2G) files.  Changing this parameter has no effect on an
-already-established database.  Default is 32.
+large (S<< > 2 GB >>) files.  Changing this parameter has no effect on an
+already-established database.  Default is C<32>.
 
-=item txn_nosync
+=item I<txn_nosync>
 
 If txn_nosync is set to false, S<Berkeley DB> flushes the log after every
 transaction.  This minimizes the number of transactions that may be lost
@@ -94,113 +126,119 @@
 in the event of a crash, but results in significantly degraded
 performance.  Default is true.
 
-=item useshm
+=item I<useshm>
 
-If useshm is set to true, S<Berkeley DB> will use shared memory instead of
+If I<useshm> is set to true, S<Berkeley DB> will use shared memory instead of
 mmap for its environment regions (cache, lock, etc).  With some platforms,
 this may improve performance.  Default is false.
 
-=item shmkey
+=item I<shmkey>
 
-Sets the shared memory key used by S<Berkeley DB> when 'useshm' is true.
+Sets the shared memory key used by S<Berkeley DB> when I<useshm> is true.
 S<Berkeley DB> will create several (usually 5) shared memory segments, using
-sequentially numbered keys starting with 'shmkey'.  Choose a key that does
+sequentially numbered keys starting with C<shmkey>.  Choose a key that does
 not conflict with any existing shared memory segments on your system.
-Default is 6400.
+Default is C<6400>.
 
-=item pagesize
+=item I<pagesize>
 
-Sets the page size for the DB files (in bytes).  Must be a power of 2.
-Best choices are 4096 or 8192.  The default is 8192.  Changing this
-parameter has no effect on an already-established database.
+Sets the page size for the DB files (in bytes).  Must be a power
+of 2.  Best choices are C<4096> or C<8192>.  The default is C<8192>.
+Changing this parameter has no effect on an already-established database.
 
-=item minkey
+=item I<minkey>
 
 Sets the minimum number of keys per page.  See the S<Berkeley DB>
-documentation for more info.  Default is based on page size
+documentation for more information.  Default is based on page size
 and whether compression is enabled:
 
    default_minkey = MAX(2, pagesize / 2600) if compress is false
    default_minkey = MAX(2, pagesize / 1500) if compress is true
 
-The lowest allowed minkey is 2.  Setting minkey higher than the default is
-not recommended, as it will cause the databases to have a lot of overflow
-pages.  Changing this parameter has no effect on an already-established
-database.
+The lowest allowed I<minkey> is C<2>.  Setting I<minkey> higher than
+the default is not recommended, as it will cause the databases to have
+a lot of overflow pages.  Changing this parameter has no effect on an
+already-established database.
 
-=item maxlocks
+=item I<maxlocks>
 
-Sets the S<Berkeley DB> "lk_max" parameter, which is the maximum number of
-locks that can exist in the database at the same time.  Default is 4000.
+Sets the S<Berkeley DB> I<lk_max> parameter, which is the maximum number of
+locks that can exist in the database at the same time.  Default is C<4000>.
 
-=item nocompact
+=item I<nocompact>
 
-The nocompact parameter affects expireover's behavior.  The expireover
-function in ovdb can do its job in one of two ways:  by simply deleting
-expired records from the database, or by re-writing the overview records
-into a different location leaving out the expired records.  The first
-method is faster, but it leaves 'holes' that result in space that can not
-immediately be reused.  The second method 'compacts' the records by
-rewriting them.
+The I<nocompact> parameter affects the behaviour of B<expireover>.
+The B<expireover> function in ovdb can do its job in one of two
+ways:  by simply deleting expired records from the database; or by
+re-writing the overview records into a different location leaving out
+the expired records.  The first method is faster, but it leaves 'holes'
+that result in space that can not immediately be reused.  The second
+method 'compacts' the records by rewriting them.
 
-If this parameter is set to 0, expireover will compact all newsgroups; if
-set to 1, expireover will not compact any newsgroups; and if set to a
-value greater than one, expireover will only compact groups that have less
-than that number of articles.
+If this parameter is set to C<0>, B<expireover> will compact all
+newsgroups; if set to C<1>, B<expireover> will not compact any
+newsgroups; and if set to a value greater than one, B<expireover>
+will only compact groups that have less than that number of articles.
 
 Experience has shown that compacting has minimal effect (other than
-making expireover take longer) so the default is now 1.  This parameter
+making B<expireover> take longer) so the default is C<1>.  This parameter
 will probably be removed in the future.
 
-=item readserver
+=item I<readserver>
 
-Normally, each nnrpd process directly accesses the S<Berkeley DB> environment.
-The process of attaching to the database (and detaching when finished) is
-fairly expensive, and can result in high loads in situations when there
-are lots of reader connections of relatively short duration.
+When the I<readserver> parameter is set to false, each B<nnrpd>
+process directly accesses the S<Berkeley DB> environment.  The process
+of attaching to the database (and detaching when finished) is fairly
+expensive, and can result in high loads in situations when there are
+lots of reader connections of relatively short duration.
 
-When the I<readserver> parameter is true, the nnrpds will access overview
-via a helper server (B<ovdb_server> S<-- which> is started by B<ovdb_init>).
-This can also result in cleaner shutdowns for the database, improving
-stability and avoiding deadlocks and corrupted databases.  If you are
-experiencing any instability in ovdb, try setting this parameter to true.
-Default is false.
+When the I<readserver> parameter is set to true, the B<nnrpd> processes
+will access overview via a helper server (B<ovdb_server> S<-- which>
+is started by B<ovdb_init>).  All ovdb reads will then be funnelled
+through a single process with a cleaner interface to the underlying
+S<Berkeley DB> database.  This will result in cleaner shutdowns for the
+database, improving stability and avoiding deadlocks, timing issues and
+corrupted databases.  That's why you should try to set this parameter to
+true if you are experiencing any instability in the ovdb overview method.
 
-=item numrsprocs
+Default value is true.
 
+=item I<numrsprocs>
+
 This parameter is only used when I<readserver> is true.  It sets the
-number of ovdb_server processes.  As each ovdb_server can process only one
-transaction at a time, running more servers can improve reader response
-times.  Default is 5.
+number of B<ovdb_server> processes.  As each B<ovdb_server> can process
+only one transaction at a time, running more servers can improve reader
+response times.  Default is C<5>.
 
-=item maxrsconn
+=item I<maxrsconn>
 
-This parameter is only used when I<readserver> is true.  It sets a maximum
-number of readers that a given ovdb_server process will serve at one time.
-This means the maximum number of readers for all of the ovdb_server
-processes is (numrsprocs * maxrsconn).  This does B<not> limit the actual
-number of readers, since nnrpd will fall back to opening the database
-directly if it can't connect to a readserver.  Default is 0, which means an
-umlimited number of connections is allowed.
+This parameter is only used when I<readserver> is true.  It sets a
+maximum number of readers that a given B<ovdb_server> process will
+serve at one time.  This means the maximum number of readers for all
+of the B<ovdb_server> processes is (I<numrsprocs> * I<maxrsconn>).
+This does I<not> limit the actual number of readers, since B<nnrpd>
+will fall back to opening the database directly if it can't connect to
+an B<ovdb_server>.  Default is C<0>, which means an unlimited number
+of connections is allowed.
 
 =back
 
 =head1 COMPRESSION
 
-New in this version of OVDB is the ability to compress overview data
+The ovdb storage method has the ability to compress overview data
 before it is stored into the database.  In addition to consuming less disk
 space, compression keeps the average size of the database keys smaller.
 This in turn increases the average number of keys per page, which can
 significantly improve performance and also helps keep the database more
-compact.  This feature requires that INN be built with zlib. Only records
+compact.  This feature requires that INN be built with zlib.  Only records
 larger than 600 bytes get compressed, because that is the point at which
 compression starts to become significant.
 
-If compression is not enabled (either from the C<compress> option in
-F<ovdb.conf> or INN was not built from zlib), the database will be backward
-compatible with older versions of OVDB.  However, if compression is enabled,
-the database is marked with a newer version that will prevent older versions
-of OVDB from opening the database.
+If compression is not enabled (either from the I<compress> option in
+F<ovdb.conf> or INN was not built with zlib support), the database
+will be backward compatible with older versions of ovdb.  However,
+if compression is enabled, the database is marked with a newer version
+that will prevent older versions of ovdb from opening the database.
 
 You can upgrade an existing database to use compression simply by setting
 I<compress> to true in F<ovdb.conf>.  Note that existing records in the
@@ -209,26 +247,26 @@
 
 If you disable compression on a database that previously had it enabled,
 new records will be stored uncompressed, but the database will still be
-incompatible with older versions of OVDB (and will also be incompatible
-with this version of OVDB if it was not built with zlib).  So to downgrade
-to a completely uncompressed database you will have to rebuild the database
-using makehistory.
+incompatible with older versions of ovdb (and will also be incompatible
+with this version of ovdb if INN was not built with zlib support).
+So to downgrade to a completely uncompressed database, you will have
+to rebuild the database using B<makehistory>.
 
 =head1 DB_CONFIG
 
-A file called F<DB_CONFIG> may be placed in the database directory to
-customize where the various database files and transaction logs are
-written.  By default, all of the files are written in the "DB_HOME"
-directory.  One way to improve performance is to put the transaction logs
-on a different disk.  To do this, put:
+A file called F<DB_CONFIG> may be placed in the database directory
+(I<pathoverview> in F<inn.conf>) to customize where the various database
+files and transaction logs are written.  By default, all of the files
+are written in the C<DB_HOME> directory.  One way to improve performance
+is to put the transaction logs on a different disk.  To do this, put:
 
     DB_LOG_DIR /path/to/logs
 
-in the F<DB_CONFIG> file.  If the pathname you give starts with a /, it is
-treated as an absolute path; otherwise, it is relative to the "DB_HOME"
+in the F<DB_CONFIG> file.  If the pathname you give starts with a C</>, it is
+treated as an absolute path; otherwise, it is relative to the C<DB_HOME>
 directory.  Make sure that any directories you specify exist and have
 proper ownership/mode before starting INN, because they won't be created
-automatically.  Also, don't change the DB_CONFIG file while anything that
+automatically.  Also, don't change the F<DB_CONFIG> file while anything that
 uses ovdb is running.
 
 Another thing that you can do with this file is to split the overview
@@ -236,9 +274,9 @@
 directories that S<Berkeley DB> will search when it goes to open a database.
 
 For example, let's say that you have I<pathoverview> set to
-F</mnt/overview> and you have four additional file systems created on
-F</mnt/ov?>.  You would create a file "/mnt/overview/DB_CONFIG" containing
-the following lines:
+F</mnt/overview> and you have four additional file systems created
+on F</mnt/ovX>.  You would create a file F</mnt/overview/DB_CONFIG>
+containing the following lines:
 
     set_data_dir /mnt/overview
     set_data_dir /mnt/ov1
@@ -246,58 +284,40 @@
     set_data_dir /mnt/ov3
     set_data_dir /mnt/ov4
 
-Distribute your ovNNNNN files into the four filesystems.  (say, 8 each).
+Distribute your F<ovNNNNN> files into the four filesystems (say, 8 each).
 When called upon to open a database file, the db library will look for it
 in each of the specified directories (in order).  If said file is not
 found, one will be created in the first of those directories.
 
-Whenever you change DB_CONFIG or move database files around, make sure all
-news processes that use the database are shut down first (including
-nnrpds).
+Whenever you change F<DB_CONFIG> or move database files around, make
+sure all news processes that use the database are shut down first
+(including B<nnrpd> processes).
 
-The DB_CONFIG functionality is part of S<Berkeley DB> itself, rather than
-something provided by ovdb.  See the S<Berkeley DB> documentation for complete
-details for the version of S<Berkeley DB> that you're running.
+The F<DB_CONFIG> functionality is part of S<Berkeley DB> itself,
+rather than something provided by ovdb.  See the S<Berkeley DB>
+documentation for complete details for the version of S<Berkeley DB>
+that you're running.
 
 =head1 RUNNING
 
-When starting the news system, B<rc.news> will invoke B<ovdb_init>.
-B<ovdb_init> must be run before using the database.  It performs the
-following tasks:
+When starting the news system, B<rc.news> will invoke the B<ovdb_init>
+program.  See the ovdb_init(8) man page for information about the tasks
+it performs.  B<ovdb_init> must be run before using the database.
 
-=over 4
-
-=item *
-
-Creates the database environment, if necessary.
-
-=item *
-
-If the database is idle, it performs a normal recovery.  The recovery will
-remove stale locks, recreate the memory pool cache, and repair any damage
-caused by a system crash or improper shutdown.
-
-=item *
-
-Starts the DB housekeeping processes (B<ovdb_monitor>) if they're not
-already running.
-
-=back
-
-And when stopping INN, B<rc.news> kills the ovdb_monitor processes after
+And when stopping INN, B<rc.news> kills the B<ovdb_monitor> processes after
 the other INN processes have been shut down.
 
 =head1 DIAGNOSTICS
 
-Problems relating to ovdb are logged to news.err with "OVDB" in the error
-message.
+Problems relating to ovdb are logged to F<news.err> with C<OVDB> in
+the error message.
 
-INN programs that use overview will fail to start up if the ovdb_monitor
-processes aren't running.  Be sure to run B<ovdb_init> before running
-anything that accesses overview.
+INN programs that use overview will fail to start up if the
+B<ovdb_monitor> processes aren't running.  Be sure to run B<ovdb_init>
+before running anything that accesses overview.
 
 Also, INN programs that use overview will fail to start up if the user
-running them is not the "news" user.
+running them is not the news user.
 
 If a program accessing the database crashes, or otherwise exits uncleanly,
 it might leave a stale lock in the database.  This lock could cause other
@@ -310,18 +330,18 @@
 
 =over 4
 
-=item inn.conf
+=item I<pathetc>/inn.conf
 
 The I<ovmethod> and I<pathoverview> parameters are relevant to ovdb.
 
-=item ovdb.conf
+=item I<pathetc>/ovdb.conf
 
 Optional configuration file for tuning.  See L<CONFIGURATION> above.
 
 =item I<pathoverview>
 
-Directory where the database goes.  S<Berkeley DB> calls it the 'DB_HOME'
-directory.
+Directory where the database goes.  S<Berkeley DB> calls it the
+C<DB_HOME> directory.
 
 =item I<pathoverview>/DB_CONFIG
 
@@ -343,21 +363,21 @@
 
 Implement a way to limit how many databases can be open at once (to reduce
 file descriptor usage); maybe using something similar to the cache code in
-ov3.c
+legacy F<ov3.c> file.
 
 =head1 HISTORY
 
-Written by Heath Kehoe <hakehoe at avalon.net> for InterNetNews
+Written by Heath Kehoe <hakehoe at avalon.net> for InterNetNews.
 
 $Id$
 
 =head1 SEE ALSO
 
-inn.conf(5), innd(8), nnrpd(8), ovdb_init(8), ovdb_monitor(8),
-ovdb_stat(8)
+inn.conf(5), innd(8), makehistory(8), nnrpd(8), ovdb_init(8),
+ovdb_monitor(8), ovdb_stat(8).
 
-S<Berkeley DB> documentation:  in the F<docs> directory of the S<Berkeley DB>
-source distribution, or on the Oracle S<Berkeley DB> web page
+S<Berkeley DB> documentation:  in the F<docs> directory of the S<Berkeley
+DB> source distribution, or on the Oracle S<Berkeley DB> web page
 (L<http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html>).
 
 =cut

Modified: doc/pod/ovdb_init.pod
===================================================================
--- doc/pod/ovdb_init.pod	2018-02-04 15:34:12 UTC (rev 10240)
+++ doc/pod/ovdb_init.pod	2018-02-04 15:38:19 UTC (rev 10241)
@@ -4,22 +4,25 @@
 
 =head1 SYNOPSIS
 
-ovdb_init [C<-u>|C<-r>]
+B<ovdb_init> [B<-r>|B<-u>]
 
 =head1 DESCRIPTION
 
 This command must be run before any other process can access the
-overview database.  It performs the following steps:
+overview database.  B<ovdb_init> is normally invoked automatically by
+B<rc.news> when starting the news system.
 
+B<ovdb_init> performs the following steps:
+
 =over 4
 
 =item 1
 
-Creates the database environment, if necessary
+Creates the database environment, if necessary.
 
 =item 2
 
-If the database is idle (and if the C<-u> option is not specified),
+If the database is idle (and if the B<-u> option is not specified),
 it performs a normal recovery.  The recovery will remove stale locks,
 recreate the memory pool cache, and repair any damage caused by a system
 crash or improper shutdown.
@@ -26,44 +29,42 @@
 
 =item 3
 
-If the C<-u> option is specified, it performs any necessary upgrades
-to the database.  See the UPGRADING section below.
+If the B<-u> option is specified, it performs any necessary upgrades
+to the database.  See the L<UPGRADING> section below.
 
 =item 4
 
-Starts the DB housekeeping processes (ovdb_monitor) if they're not
-already running. (Unless the C<-r> option is specified).
+Starts the database housekeeping processes (B<ovdb_monitor>) if they are
+not already running.  (Unless the B<-r> option is specified).
 
 =item 5
 
-Starts the ovdb readserver (ovdb_server) processes if I<readserver>
+Starts the ovdb readserver processes (B<ovdb_server>) if I<readserver>
 in F<ovdb.conf> is true, and if they are not already running.  (Unless
-the C<-r> option is specified).
+the B<-r> option is specified).
 
 =back
 
-Returns exit status of 0 if all steps were completed successfully.
+Returns exit status of C<0> if all steps were completed successfully.
 In the event of an error, messages are written to syslog and/or stderr.
 
-If a recovery was attempted but it failed, the database may be
-damaged beyond repair, requiring a rebuild with makehistory(8).
+If a recovery was attempted but failed, the database may be
+damaged beyond repair, requiring a rebuild with B<makehistory>.
 
-This command is normally invoked automatically by rc.news(8).
+This command can be run multiple times.
 
-It is OK to run this command multiple times.
-
 =head1 OPTIONS
 
 =over 4
 
-=item C<-r>
+=item B<-r>
 
-Perform recovery only.  C<ovdb_monitor> is not started.
+Perform recovery only.  B<ovdb_monitor> is not started.
 
-=item C<-u>
+=item B<-u>
 
 Perform any needed upgrades.  Recovery is not attempted.
-C<ovdb_monitor> is started if the upgrade succeeded.
+B<ovdb_monitor> is started if the upgrade succeeded.
 
 =back
 
@@ -82,12 +83,13 @@
 
 =item *
 
-You upgrade ovdb to a newer major version; i.e., ovdb-1.0 to ovdb-2.0.
+You upgrade ovdb to a newer major version; i.e., ovdb-1.0 (shipped with
+S<INN 2.3.0> up to S<INN 2.3.5>) to ovdb-2.0 (since S<INN 2.4.0>).
 
 =back
 
 In both of these cases, the database is upgraded in-place; and the
-upgrade can not be undone.  Do not interrupt the upgrade process once
+upgrade cannot be undone.  Do not interrupt the upgrade process once
 it has started, because there is a risk of irrepairable corruption.
 The upgrade may take several minutes to complete.
 If an upgrade does get interrupted, try running the upgrade again.
@@ -99,7 +101,7 @@
 
 =item 1
 
-Build and install the S<Berkeley DB 3.1.17>;
+Build and install the S<Berkeley DB 3.1.17> version;
 
 =item 2
 
@@ -125,20 +127,20 @@
 
 =item 7
 
-Start INN with C<rc.news>.
+Start INN with the C<rc.news> command.
 
 =back
 
-It is OK to specify C<-u> even if no upgrades are needed.
+Note that the B<-u> option can be used even if no upgrades are needed.
 
 =head1 HISTORY
 
-Written by Heath Kehoe E<lt>hakehoe at avalon.netE<gt> for InterNetNews.
+Written by Heath Kehoe <hakehoe at avalon.net> for InterNetNews.
 
 $Id$
 
 =head1 SEE ALSO
 
-ovdb(5), makehistory(8)
+ovdb(5), makehistory(8), rc.news(8).
 
 =cut

Modified: doc/pod/ovdb_monitor.pod
===================================================================
--- doc/pod/ovdb_monitor.pod	2018-02-04 15:34:12 UTC (rev 10240)
+++ doc/pod/ovdb_monitor.pod	2018-02-04 15:38:19 UTC (rev 10241)
@@ -4,29 +4,33 @@
 
 =head1 SYNOPSIS
 
-Use C<ovdb_init> to start ovdb_monitor
+Use B<ovdb_init> to start B<ovdb_monitor>
 
 =head1 DESCRIPTION
 
-When started (by C<ovdb_init>), C<ovdb_monitor> forks three processes
-that perform routine database maintenance tasks.  These are:
-transaction checkpointing, deadlock detection, and transaction log
-removal.  The process ID of the parent is written to
-F<I<pathrun>/ovdb_monitor.pid>.  This PID is used by other INN
-commands to verify that ovdb_monitor is running.
+When started (normally by B<ovdb_init> that is invoked by B<rc.news>),
+B<ovdb_monitor> forks three processes that perform routine database
+maintenance tasks.  These are transaction checkpointing, deadlock
+detection, and transaction log removal.
 
-To shut down ovdb_monitor, send a TERM signal to the process ID
-in F<I<pathrun>/ovdb_monitor.pid> .  The parent process will shut
-down the three children and wait for their exit before exiting itself.
+The process ID of the parent is written to F<ovdb_monitor.pid> in the
+I<pathrun> directory.  This PID is used by other INN commands to verify
+that B<ovdb_monitor> is running.
 
+To shut down B<ovdb_monitor>, send a TERM signal to the process ID
+in F<ovdb_monitor.pid>.  The parent process will shut down the three
+children and wait for their exit before exiting itself.  Note that when
+running the C<rc.news stop> command to stop the news system, B<rc.news>
+automatically takes care of stopping B<ovdb_monitor>.
+
 =head1 HISTORY
 
-Written by Heath Kehoe E<lt>hakehoe at avalon.netE<gt> for InterNetNews.
+Written by Heath Kehoe <hakehoe at avalon.net> for InterNetNews.
 
 $Id$
 
 =head1 SEE ALSO
 
-ovdb(5), ovdb_init(8)
+ovdb(5), ovdb_init(8), rc.news(8).
 
 =cut

Modified: doc/pod/ovdb_stat.pod
===================================================================
--- doc/pod/ovdb_stat.pod	2018-02-04 15:34:12 UTC (rev 10240)
+++ doc/pod/ovdb_stat.pod	2018-02-04 15:38:19 UTC (rev 10241)
@@ -4,15 +4,15 @@
 
 =head1 SYNOPSIS
 
-B<ovdb_stat> B<-Hgci> [B<-r> I<artnumrange>] newsgroup [newsgroup ...]
+B<ovdb_stat> [B<-Hgci>] [B<-r> I<artnumrange>] I<newsgroup> [I<newsgroup> ...]
 
-B<ovdb_stat> B<-Hklmtv> [B<-d> I<database>]
+B<ovdb_stat> B<-HklmMtv> [B<-d> I<database>]
 
 =head1 DESCRIPTION
 
 B<ovdb_stat> displays information from the ovdb database:  S<Berkeley DB>
-statistics, newsgroup data, and overview records; and optionally
-outputs in HTML format.
+statistics, newsgroup data, and overview records.  The output can
+optionally be in HTML format.
 
 =head1 OPTIONS
 
@@ -20,14 +20,16 @@
 
 =item B<-g>
 
-Newsgroup himark, lowmark, article count, and flag for the given newsgroups
-(as stored in the ovdb "groupinfo" database) are displayed.
+Newsgroup high water mark, low marker mark, article count, and flag
+for the given newsgroups (as stored in the ovdb F<groupinfo> database)
+are displayed.
 
 =item B<-c>
 
-Similar to B<-g>, except the himark, lowmark, and count are calculated
-by actually scanning the overview records and counting them.
-This can be a lengthy operation on groups with lots of articles.
+Similar to B<-g>, except the high water mark, low water mark, and
+article count are calculated by actually scanning the overview records
+and counting them.  This can be a lengthy operation on groups with lots
+of articles.
 
 =item B<-i>
 
@@ -36,7 +38,7 @@
 =item B<-r> I<artnumrange>
 
 Overview records are retrieved.  The I<artnumrange> parameter may be
-a single article number, or a range of articles in the format C<low-hi>.
+a single article number, or a range of articles in the format C<low-high>.
 
 =item B<-H>
 
@@ -44,13 +46,13 @@
 
 =item B<-k>
 
-Displays lock region statistics, as returned by the S<Berkeley DB> lock_stat()
-call.
+Displays lock region statistics, as returned by the S<Berkeley DB>
+lock_stat() call.
 
 =item B<-l>
 
-Displays log region statistics, as returned by the S<Berkeley DB> log_stat()
-call.
+Displays log region statistics, as returned by the S<Berkeley DB>
+log_stat() call.
 
 =item B<-m>
 
@@ -64,8 +66,8 @@
 
 =item B<-t>
 
-Displays log region statistics, as returned by the S<Berkeley DB> txn_stat()
-call.
+Displays log region statistics, as returned by the S<Berkeley DB>
+txn_stat() call.
 
 =item B<-v>
 
@@ -81,19 +83,19 @@
 
 =head1 WARNINGS
 
-ovdb_stat may be safely killed with the INT, TERM, or HUP signals.
+B<ovdb_stat> may be safely killed with the INT, TERM, or HUP signals.
 It catches those signals and exits cleanly.
-Do not kill ovdb_stat with other signals, unless absolutely necessary,
-because it may leave stale locks in the DB environment.
+Do not kill B<ovdb_stat> with other signals, unless absolutely necessary,
+because it may leave stale locks in the database environment.
 
 =head1 HISTORY
 
-Written by Heath Kehoe E<lt>hakehoe at avalon.netE<gt> for InterNetNews.
+Written by Heath Kehoe <hakehoe at avalon.net> for InterNetNews.
 
 $Id$
 
 =head1 SEE ALSO
 
-ovdb(5)
+ovdb(5).
 
 =cut

Modified: samples/ovdb.conf
===================================================================
--- samples/ovdb.conf	2018-02-04 15:34:12 UTC (rev 10240)
+++ samples/ovdb.conf	2018-02-04 15:38:19 UTC (rev 10241)
@@ -13,14 +13,20 @@
 # In general, the bigger the cache, the better.  Use 'ovdb_stat -m' to see
 # cache hit percentages.  If they're less than 80%, try increasing the
 # cache size.  To make a change of this parameter take effect, shut down
-# and restart INN (be sure to kill all of the nnrpds when shutting down).
-# Default is 8000, which is adequate for small to medium-sized servers.
-# Large servers will probably need at least 14000.
+# and restart INN (be sure to kill all of the nnrpd processes when shutting
+# down).  Default is 8000 KB, which is adequate for small to medium-sized
+# servers.  Large servers will probably need at least 20000 KB.
 #cachesize	8000
 
+# Number of regions across which to split the cache.  The region size
+# is equal to cachesize divided by ncache.
+# Default is 1 for ncache, that is to say the cache will be allocated
+# contiguously in memory.
+#ncache		1
+
 # Overview data is split between this many files.  Currently,
 # innd will keep all of the files open, so don't set this too high
-# or innd may run out of file descriptors.  The nnrpds only open one
+# or innd may run out of file descriptors.  nnrpd only opens one
 # at a time, regardless.  May be set to one, or just a few, but only
 # do that if your OS supports large (> 2 GB) files.  Changing this
 # parameter has no effect on an already-established database.
@@ -50,7 +56,8 @@
 #pagesize	8192
 
 # Sets the minimum number of keys per page.  See the Berkeley DB
-# documentation for more info.  Default is based on page size:
+# documentation for more information.  Default is based on page size
+# and whether compression is enabled:
 #
 #     default_minkey = MAX(2, pagesize / 2600)  if compress is false
 #     default_minkey = MAX(2, pagesize / 1500)  if compress is true
@@ -66,7 +73,7 @@
 # is 4000.
 #maxlocks	4000
 
-# The nocompact parameter affects expireover's behavior.  The expireover
+# The nocompact parameter affects the behaviour of expireover.  The expireover
 # function in ovdb can do its job in one of two ways:  by simply deleting
 # expired records from the database; or by re-writing the overview records
 # into a different location leaving out the expired records.  The first
@@ -77,22 +84,27 @@
 # If this parameter is set to 0, expireover will compact all newsgroups;
 # if set to 1, expireover will not compact any newsgroups; and if set to
 # a value greater than one, expireover will only compact groups that
-# have less than that number of articles.  Default is 1000.
+# have less than that number of articles.
 #
 # Experience has shown that compacting has minimal effect (other than
-# making expireover take longer) so the default is now 1.  This parameter
+# making expireover take longer) so the default is 1.  This parameter
 # will probably be removed in the future.
 #nocompact	1
 
-# Normally, each nnrpd process directly accesses the Berkeley DB environment.
-# The process of attaching to the database (and detaching when finished) is
-# fairly expensive, and can result in high loads in situations when there are
-# lots of reader connections of relatively short duration.
+# When the readserver parameter is set to false, each nnrpd process directly
+# accesses the Berkeley DB environment.  The process of attaching to the
+# database (and detaching when finished) is fairly expensive, and can result
+# in high loads in situations when there are lots of reader connections
+# of relatively short duration.
 # 
-# When the readserver parameter is "true", the nnrpds will access overview
-# via a helper server (ovdb_server -- which is started by ovdb_init).
-# Default is false.
-#readserver	false
+# When the readserver parameter is set to true, the nnrpd processes will access
+# overview via a helper server (ovdb_server -- which is started by ovdb_init).
+# This can also result in cleaner shutdowns for the database, improving
+# stability and avoiding deadlocks and corrupted databases.  That's why
+# you should try to set this parameter to true if you are experiencing
+# any instability in ovdb.
+# Default value is true.
+#readserver	true
 
 # This parameter is only used when 'readserver' is true.  It sets the number
 # of ovdb_server processes.  As each ovdb_server can process only one
@@ -103,7 +115,9 @@
 # This parameter is only used when 'readserver' is true.  It sets a maximum
 # number of readers that a given ovdb_server process will serve at one time.
 # This means the maximum number of readers for all of the ovdb_server
-# processes is (numrsprocs * maxrsconn).  Default is 0, which means an
-# umlimited number of connections is allowed.
+# processes is (numrsprocs * maxrsconn).  This does not limit the actual
+# number of readers, since nnrpd will fall back to opening the database
+# directly if it can't connect to an ovdb_server.  Default is 0, which means
+# an unlimited number of connections is allowed.
 #maxrsconn	0
 

Modified: storage/ovdb/ovdb.c
===================================================================
--- storage/ovdb/ovdb.c	2018-02-04 15:34:12 UTC (rev 10240)
+++ storage/ovdb/ovdb.c	2018-02-04 15:38:19 UTC (rev 10241)
@@ -413,7 +413,7 @@
     ovdb_conf.minkey = 0;
     ovdb_conf.maxlocks = 4000;
     ovdb_conf.nocompact = 1;
-    ovdb_conf.readserver = 0;
+    ovdb_conf.readserver = 1;
     ovdb_conf.numrsprocs = 5;
     ovdb_conf.maxrsconn = 0;
     ovdb_conf.useshm = 0;



More information about the inn-committers mailing list