user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@yhbt.net>
To: meta@public-inbox.org
Subject: [PATCH 3/5] index: max out XAPIAN_FLUSH_THRESHOLD if using --batch-size
Date: Fri,  7 Aug 2020 10:52:16 +0000	[thread overview]
Message-ID: <20200807105218.16843-4-e@yhbt.net> (raw)
In-Reply-To: <20200807105218.16843-1-e@yhbt.net>

If XAPIAN_FLUSH_THRESHOLD is unset, Xapian will default to
10000.  That limits the effectiveness of users specifying
extremely large values of --batch-size.

While we're at it, localize the changes to globals since -index
may be eval-ed in tests (and perhaps production code in the
future).
---
 script/public-inbox-index | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/script/public-inbox-index b/script/public-inbox-index
index 56df5bfe..e2bca16e 100755
--- a/script/public-inbox-index
+++ b/script/public-inbox-index
@@ -42,11 +42,16 @@ if (defined $max_size) {
 		die "`publicInbox.indexMaxSize=$max_size' not parsed\n";
 }
 
-if (my $bs = $opt->{batchsize} // $cfg->{lc('publicInbox.indexBatchSize')}) {
+my $bs = $opt->{batchsize} // $cfg->{lc('publicInbox.indexBatchSize')};
+if (defined $bs) {
 	PublicInbox::Admin::parse_unsigned(\$bs) or
 		die "`publicInbox.indexBatchSize=$bs' not parsed\n";
-	$PublicInbox::SearchIdx::BATCH_BYTES = $bs;
 }
+local $PublicInbox::SearchIdx::BATCH_BYTES = $bs if defined($bs);
+
+# out-of-the-box builds of Xapian 1.4.x are still limited to 32-bit
+# https://getting-started-with-xapian.readthedocs.io/en/latest/concepts/indexing/limitations.html
+local $ENV{XAPIAN_FLUSH_THRESHOLD} ||= '4294967295' if defined($bs);
 
 my $s = $opt->{sequentialshard} //
 			$cfg->{lc('publicInbox.indexSequentialShard')};

  parent reply	other threads:[~2020-08-07 10:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-07 10:52 [PATCH 0/5] more indexing improvements Eric Wong
2020-08-07 10:52 ` [PATCH 1/5] v2writable: fix batch size accounting Eric Wong
2020-08-07 13:13   ` Eric Wong
2020-08-07 10:52 ` [PATCH 2/5] index: --compact respects --sequential-shard Eric Wong
2020-08-07 10:52 ` Eric Wong [this message]
2020-08-07 10:52 ` [PATCH 4/5] searchidx: use Perl truthiness to detect XAPIAN_FLUSH_THRESHOLD Eric Wong
2020-08-07 10:52 ` [PATCH 5/5] index: add built-in --help / -? Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200807105218.16843-4-e@yhbt.net \
    --to=e@yhbt.net \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).