use DBD::SQLite;
use File::Temp qw(tempfile);
use PublicInbox::Over;
+use PublicInbox::Spawn;
sub new {
my ($class, $git_dir, $writable) = @_;
# used to keep track of used numeric mappings for v2 reindex
sub tmp_clone {
- my ($self) = @_;
- my ($fh, $fn) = tempfile('msgmap-XXXXXXXX', EXLOCK => 0, TMPDIR => 1);
+ 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);
$self->{dbh} and die 'BUG: tmp_clone dbh not prepared for parent';
defined($self->{filename}) or die 'BUG: {filename} not defined';
$self->{dbh} = PublicInbox::Over::dbh_new($self, 2);
+ $self->{dbh}->do('PRAGMA journal_mode = MEMORY');
}
sub atfork_prepare {