diff options
author | Eric Wong <e@yhbt.net> | 2020-08-25 03:02:47 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-08-26 06:10:52 +0000 |
commit | 5f6a0d2342323541e44ff2f1e7329053d0263800 (patch) | |
tree | ec2243f42f3aebcacd08be07bc1b2dd06267092a /t | |
parent | 793dcb03635e167143c9df6897999f4698a5133c (diff) | |
download | public-inbox-5f6a0d2342323541e44ff2f1e7329053d0263800.tar.gz |
WAL actually seems to have ideal locking characteristics given concurrency problems I'm experiencing with --reindex running in parallel with expensive read-only SQLite queries: <https://public-inbox.org/meta/20200825001204.GA840@dcvr/> Unfortunately, we cannot blindly use WAL while preserving compatibility with existing setups nor our guarantees that read-only daemons are indeed "read-only". However, respect an user's the choice to set WAL on their own if they're comfortable with giving -nntpd/-httpd/-imapd processes write permission to the directory storing SQLite DBs.
Diffstat (limited to 't')
-rw-r--r-- | t/over.t | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -65,4 +65,14 @@ isnt($over->max, 0, 'max is non-zero'); $over->rollback_lazy; +# L<perldata/"Version Strings"> +my $v = eval 'v'.$over->{dbh}->{sqlite_version}; +SKIP: { + skip("no WAL in SQLite version $v < 3.7.0", 1) if $v lt v3.7.0; + $over->{dbh}->do('PRAGMA journal_mode = WAL'); + $over = PublicInbox::OverIdx->new("$tmpdir/over.sqlite3"); + is($over->connect->selectrow_array('PRAGMA journal_mode'), 'wal', + 'WAL journal_mode not clobbered if manually set'); +} + done_testing(); |