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=-4.0 required=3.0 tests=ALL_TRUSTED,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 475B41F5AE for ; Wed, 29 Jul 2020 21:25:43 +0000 (UTC) Date: Wed, 29 Jul 2020 21:25:43 +0000 From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] msgmap: disable CoW for tmp_clone, too Message-ID: <20200729212542.GA14149@dcvr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline List-Id: The temporary clone starts as large as the full msgmap and deletes will write to it randomly. So ensure it doesn't get fragmented and slower as time goes on. --- lib/PublicInbox/Msgmap.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/PublicInbox/Msgmap.pm b/lib/PublicInbox/Msgmap.pm index 51b6a68c..c85e7796 100644 --- a/lib/PublicInbox/Msgmap.pm +++ b/lib/PublicInbox/Msgmap.pm @@ -14,6 +14,7 @@ use DBI; use DBD::SQLite; use File::Temp qw(tempfile); use PublicInbox::Over; +use PublicInbox::Spawn; sub new { my ($class, $git_dir, $writable) = @_; @@ -50,6 +51,7 @@ sub new_file { sub tmp_clone { my ($self, $dir) = @_; my ($fh, $fn) = tempfile('msgmap-XXXXXXXX', EXLOCK => 0, DIR => $dir); + PublicInbox::Spawn::set_nodatacow(fileno($fh)); my $tmp; if ($self->{dbh}->can('sqlite_backup_to_dbh')) { $tmp = ref($self)->new_file($fn, 2);