]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
v2: don't set No_COW for git repos
authorEric Wong <e@80x24.org>
Sat, 7 Dec 2024 02:05:48 +0000 (02:05 +0000)
committerEric Wong <e@80x24.org>
Sun, 8 Dec 2024 22:04:25 +0000 (22:04 +0000)
Unlike Xapian and SQLite DBs, data stored in git is both
precious and written sequentially.  Thus disabling copy-on-write
doesn't make sense for git objects since the problems with
copy-on-write don't apply here while the benefits of CoW do.

lib/PublicInbox/V2Writable.pm

index 257519660c4ea96809514bece354b1b90bc19c29..af9aaef32e17cb00d5d6da0c8a8be9351e380e09 100644 (file)
@@ -82,11 +82,11 @@ sub init_inbox {
                $self->{parallel} = 0 if $shards == 0;
                $self->{shards} = $shards if $shards > 0;
        }
-       $self->idx_init;
-       $self->{mm}->skip_artnum($skip_artnum) if defined $skip_artnum;
        my $max = $self->{ibx}->max_git_epoch;
        $max = $skip_epoch if (defined($skip_epoch) && !defined($max));
        $self->{mg}->add_epoch($max // 0);
+       $self->idx_init;
+       $self->{mm}->skip_artnum($skip_artnum) if defined $skip_artnum;
        $self->done;
 }