From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 9BE5F1FF9E for ; Fri, 25 Dec 2020 10:21:15 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 5/7] index: fix --no-fsync flag propagation to extindex Date: Fri, 25 Dec 2020 10:21:13 +0000 Message-Id: <20201225102115.6745-6-e@80x24.org> In-Reply-To: <20201225102115.6745-1-e@80x24.org> References: <20201225102115.6745-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Negation in flag names are confusing, but trying to deviate from the DB_NO_SYNC name used by Xapian is also confusing. --- lib/PublicInbox/ExtSearchIdx.pm | 2 +- script/public-inbox-index | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/PublicInbox/ExtSearchIdx.pm b/lib/PublicInbox/ExtSearchIdx.pm index 3f197973..e7fdae48 100644 --- a/lib/PublicInbox/ExtSearchIdx.pm +++ b/lib/PublicInbox/ExtSearchIdx.pm @@ -54,7 +54,7 @@ sub new { }, __PACKAGE__; $self->{shards} = $self->count_shards || nproc_shards($opt->{creat}); my $oidx = PublicInbox::OverIdx->new("$self->{xpfx}/over.sqlite3"); - $oidx->{-no_fsync} = 1 if $opt->{-no_fsync}; + $self->{-no_fsync} = $oidx->{-no_fsync} = 1 if !$opt->{fsync}; $self->{oidx} = $oidx; $self } diff --git a/script/public-inbox-index b/script/public-inbox-index index a17bf615..c68f9224 100755 --- a/script/public-inbox-index +++ b/script/public-inbox-index @@ -85,7 +85,7 @@ for my $ei_name (@$update_extindex) { die "extindex `$ei_name' not configured or found\n"; } $eidx_seen{$topdir} //= - push(@eidx, PublicInbox::ExtSearchIdx->new($topdir)); + push(@eidx, PublicInbox::ExtSearchIdx->new($topdir, $opt)); } my $mods = {}; my @eidx_unconfigured; @@ -141,7 +141,6 @@ EOL $eidx->attach_inbox($ibx); } } -$opt->{-no_fsync} = 1 if !$opt->{fsync}; my $pr = $opt->{-progress}; for my $eidx (@eidx) { $pr->("indexing $eidx->{topdir} ...\n") if $pr;