about summary refs log tree commit homepage
path: root/lib/PublicInbox/ExtSearchIdx.pm
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 /lib/PublicInbox/ExtSearchIdx.pm
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 'lib/PublicInbox/ExtSearchIdx.pm')
-rw-r--r--lib/PublicInbox/ExtSearchIdx.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/PublicInbox/ExtSearchIdx.pm b/lib/PublicInbox/ExtSearchIdx.pm
index 4b46fa16..7c44a1a4 100644
--- a/lib/PublicInbox/ExtSearchIdx.pm
+++ b/lib/PublicInbox/ExtSearchIdx.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 2020-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 
 # Detached/external index cross inbox search indexing support
@@ -59,6 +59,7 @@ sub new {
                 nproc_shards({ nproc => $opt->{jobs} });
         my $oidx = PublicInbox::OverIdx->new("$self->{xpfx}/over.sqlite3");
         $self->{-no_fsync} = $oidx->{-no_fsync} = 1 if !$opt->{fsync};
+        $self->{-dangerous} = 1 if $opt->{dangerous};
         $self->{oidx} = $oidx;
         $self
 }