about summary refs log tree commit homepage
path: root/script/public-inbox-index
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-03-07 10:57:37 +0000
committerEric Wong <e@80x24.org>2022-03-08 00:30:03 +0000
commit3eec2f7792040f75f3988c520f308e2445baf645 (patch)
treee581cdd77765c84ae870999f36193e4302f5df71 /script/public-inbox-index
parent798bd392d273735a69f0b009e70d8bb2dbc4a7e4 (diff)
downloadpublic-inbox-3eec2f7792040f75f3988c520f308e2445baf645.tar.gz
This enables Xapian::DB_DANGEROUS to support in-place updates.
This can speed up the initial index and reduce I/O at the cost
of preventing concurrent readers and being unsafe in the face of
any abnormal terminations.  This is more dangerous than
--no-fsync.  --no-fsync is only unsafe in the event of a power
loss or kernel crash; --dangerous is unsafe even on SIGKILL.
Diffstat (limited to 'script/public-inbox-index')
-rwxr-xr-xscript/public-inbox-index3
1 files changed, 2 insertions, 1 deletions
diff --git a/script/public-inbox-index b/script/public-inbox-index
index 053d8b94..a04be9fc 100755
--- a/script/public-inbox-index
+++ b/script/public-inbox-index
@@ -39,7 +39,7 @@ my $opt = {
         'update-extindex' => [], # ":s@" optional arg sets '' if no arg given
 };
 GetOptions($opt, qw(verbose|v+ reindex rethread compact|c+ jobs|j=i prune
-                fsync|sync! xapian_only|xapian-only
+                fsync|sync! xapian_only|xapian-only dangerous
                 indexlevel|index-level|L=s max_size|max-size=s
                 batch_size|batch-size=s
                 since|after=s until|before=s
@@ -126,6 +126,7 @@ for my $ibx (@ibxs) {
                 PublicInbox::Xapcmd::run($ibx, 'compact', $opt->{compact_opt});
         }
         $ibx->{-no_fsync} = 1 if !$opt->{fsync};
+        $ibx->{-dangerous} = 1 if $opt->{dangerous};
         $ibx->{-skip_docdata} //= $opt->{'skip-docdata'};
 
         my $ibx_opt = $opt;