From 3eec2f7792040f75f3988c520f308e2445baf645 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 7 Mar 2022 10:57:37 +0000 Subject: index|extindex: support --dangerous flag 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. --- lib/PublicInbox/MiscIdx.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/PublicInbox/MiscIdx.pm') diff --git a/lib/PublicInbox/MiscIdx.pm b/lib/PublicInbox/MiscIdx.pm index dc15442d..5faf5c66 100644 --- a/lib/PublicInbox/MiscIdx.pm +++ b/lib/PublicInbox/MiscIdx.pm @@ -31,6 +31,7 @@ sub new { PublicInbox::Syscall::nodatacow_dir($mi_dir); my $flags = $PublicInbox::SearchIdx::DB_CREATE_OR_OPEN; $flags |= $PublicInbox::SearchIdx::DB_NO_SYNC if $eidx->{-no_fsync}; + $flags |= $PublicInbox::SearchIdx::DB_DANGEROUS if $eidx->{-dangerous}; $json //= PublicInbox::Config::json(); bless { mi_dir => $mi_dir, -- cgit v1.2.3-24-ge0c7