about summary refs log tree commit
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-07-29 21:25:43 +0000
committerEric Wong <e@yhbt.net>2020-07-30 09:36:42 +0000
commitae6a9be7afc6902f9b8970b3656af241d6bc1d9f (patch)
tree30aba3f467bcdc632187e94de85ec06473bda6a5
parent41ecd08ee60daa495de3a2fc2c0296dc9cc9a0b3 (diff)
downloadpublic-inbox-ae6a9be7afc6902f9b8970b3656af241d6bc1d9f.tar.gz
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.
-rw-r--r--lib/PublicInbox/Msgmap.pm2
1 files changed, 2 insertions, 0 deletions
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);