about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchIdx.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-08-07 01:14:06 +0000
committerEric Wong <e@yhbt.net>2020-08-07 23:45:39 +0000
commit8b1950055d51d4360e596446e5ac0f41008e357d (patch)
tree2fb3195c07e82a62e96bc3841a2f5dbd7da602d6 /lib/PublicInbox/SearchIdx.pm
parent99def67b86c4d270e8cfda4d1fad418291b6f3a4 (diff)
downloadpublic-inbox-8b1950055d51d4360e596446e5ac0f41008e357d.tar.gz
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).
Diffstat (limited to 'lib/PublicInbox/SearchIdx.pm')
-rw-r--r--lib/PublicInbox/SearchIdx.pm6
1 files changed, 3 insertions, 3 deletions
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);
         };
 }