From 8b1950055d51d4360e596446e5ac0f41008e357d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 7 Aug 2020 01:14:06 +0000 Subject: index+xcpdb: rename `--no-sync' to `--no-fsync' We'll continue supporting `--no-sync' even if its yet-to-make it it into a release, but the term `sync' is overloaded in our codebase which may be confusing to new hackers and users. None of our our code nor dependencies issue the sync(2) syscall, either, only fsync(2) and fdatasync(2). --- lib/PublicInbox/SearchIdx.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/PublicInbox/SearchIdx.pm') diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index a1baa65b..22489731 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -67,7 +67,7 @@ sub new { $self->{lock_path} = "$inboxdir/ssoma.lock"; my $dir = $self->xdir; $self->{over} = PublicInbox::OverIdx->new("$dir/over.sqlite3"); - $self->{over}->{-no_sync} = 1 if $ibx->{-no_sync}; + $self->{over}->{-no_fsync} = 1 if $ibx->{-no_fsync}; $self->{index_max_size} = $ibx->{index_max_size}; } elsif ($version == 2) { defined $shard or die "shard is required for v2\n"; @@ -138,7 +138,7 @@ sub idx_acquire { } } return unless defined $flag; - $flag |= $DB_NO_SYNC if $self->{ibx}->{-no_sync}; + $flag |= $DB_NO_SYNC if $self->{ibx}->{-no_fsync}; my $xdb = eval { ($X->{WritableDatabase})->new($dir, $flag) }; if ($@) { die "Failed opening $dir: ", $@; @@ -389,7 +389,7 @@ sub _msgmap_init ($) { die "BUG: _msgmap_init is only for v1\n" if $self->{ibx_ver} != 1; $self->{mm} //= eval { require PublicInbox::Msgmap; - my $rw = $self->{ibx}->{-no_sync} ? 2 : 1; + my $rw = $self->{ibx}->{-no_fsync} ? 2 : 1; PublicInbox::Msgmap->new($self->{ibx}->{inboxdir}, $rw); }; } -- cgit v1.2.3-24-ge0c7