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 5FC201F55B for ; Mon, 25 May 2020 03:30:20 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] msgmap: tmp_clone: use in-memory journal Date: Mon, 25 May 2020 03:30:20 +0000 Message-Id: <20200525033020.20198-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This prevents $TMPDIR from being littered with *-journal files after running the test suite. This shouldn't cause excessive memory use since $v2w->{mm_tmp} doesn't see big transactions. There's no need to worry about data loss, here,either, since this is just a temporary clone we've even disabled fsync on. Fixes: 78888d36fb80889f ("msgmap: use TRUNCATE for journal_mode, for now") --- lib/PublicInbox/Msgmap.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/PublicInbox/Msgmap.pm b/lib/PublicInbox/Msgmap.pm index 5fe14383ac4..a2ffe7203e7 100644 --- a/lib/PublicInbox/Msgmap.pm +++ b/lib/PublicInbox/Msgmap.pm @@ -70,6 +70,7 @@ sub tmp_clone { $self->{dbh}->sqlite_backup_to_file($fn); my $tmp = ref($self)->new_file($fn, 1); $tmp->{dbh}->do('PRAGMA synchronous = OFF'); + $tmp->{dbh}->do('PRAGMA journal_mode = MEMORY'); $tmp->{tmp_name} = $fn; # SQLite won't work if unlinked, apparently $tmp->{pid} = $$; close $fh or die "failed to close $fn: $!";