diff options
author | Eric Wong <e@yhbt.net> | 2020-08-20 20:24:56 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-08-20 21:11:24 +0000 |
commit | f344d64066f85dd6737daeb42c94902e1bbfda78 (patch) | |
tree | 9a68a2a657a13ec245cfe360031b601a4d9d0c5c /t/init.t | |
parent | f62ddb19552b19f398d56193d7cf20cf20b61a04 (diff) | |
download | public-inbox-f344d64066f85dd6737daeb42c94902e1bbfda78.tar.gz |
Since we no longer read document data from Xapian, allow users to opt-out of storing it. This breaks compatibility with previous releases of public-inbox, but gives us a ~1.5% space savings on Xapian storage (and associated I/O and page cache pressure reduction).
Diffstat (limited to 't/init.t')
-rw-r--r-- | t/init.t | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -95,6 +95,19 @@ SKIP: { my $ibx = PublicInbox::Inbox->new({ inboxdir => $dir }); is(PublicInbox::Admin::detect_indexlevel($ibx), $lvl, 'detected expected level w/o config'); + ok(!$ibx->{-skip_docdata}, 'docdata written by default'); + } + for my $v (1, 2) { + my $name = "v$v-skip-docdata"; + my $dir = "$tmpdir/$name"; + $cmd = [ '-init', $name, "-V$v", '--skip-docdata', + $dir, "http://example.com/$name", + "$name\@example.com" ]; + ok(run_script($cmd), "-init -V$v --skip-docdata"); + my $ibx = PublicInbox::Inbox->new({ inboxdir => $dir }); + is(PublicInbox::Admin::detect_indexlevel($ibx), 'full', + "detected default indexlevel -V$v"); + ok($ibx->{-skip_docdata}, "docdata skip set -V$v"); } # loop for idempotency |