about summary refs log tree commit homepage
path: root/t
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 /t
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 't')
-rw-r--r--t/extsearch.t5
-rw-r--r--t/indexlevels-mirror.t4
2 files changed, 5 insertions, 4 deletions
diff --git a/t/extsearch.t b/t/extsearch.t
index dfc190e2..09cbdabe 100644
--- a/t/extsearch.t
+++ b/t/extsearch.t
@@ -1,5 +1,5 @@
 #!perl -w
-# 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>
 use strict;
 use Test::More;
@@ -54,7 +54,8 @@ run_script(['-mda', '--no-precheck'], $env, { 0 => $fh }) or BAIL_OUT '-mda';
 
 run_script([qw(-index -Lbasic), "$home/v1test"]) or BAIL_OUT "index $?";
 
-ok(run_script([qw(-extindex --all), "$home/extindex"]), 'extindex init');
+ok(run_script([qw(-extindex --dangerous --all), "$home/extindex"]),
+        'extindex init');
 {
         my $es = PublicInbox::ExtSearch->new("$home/extindex");
         ok($es->has_threadid, '->has_threadid');
diff --git a/t/indexlevels-mirror.t b/t/indexlevels-mirror.t
index e606e79b..ac85643d 100644
--- a/t/indexlevels-mirror.t
+++ b/t/indexlevels-mirror.t
@@ -1,5 +1,5 @@
 #!perl -w
-# Copyright (C) 2019-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>
 use strict;
 use v5.10.1;
@@ -34,7 +34,7 @@ my $import_index_incremental = sub {
         local $ENV{PI_CONFIG} = "$tmpdir/config";
 
         # index master (required for v1)
-        my @cmd = (qw(-index -j0), $ibx->{inboxdir}, "-L$level");
+        my @cmd = (qw(-index -j0 --dangerous), $ibx->{inboxdir}, "-L$level");
         push @cmd, '-c' if have_xapian_compact;
         ok(run_script(\@cmd, undef, { 2 => \$err }), 'index master');
         my $ro_master = PublicInbox::Inbox->new({