about summary refs log tree commit homepage
path: root/lib/PublicInbox/V2Writable.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-11-23 07:05:51 +0000
committerEric Wong <e@80x24.org>2020-11-24 05:03:55 +0000
commit58e764d179131b0fba8590915e2528248be26329 (patch)
tree18a24739cb8bcc1ec4704772475e8e2dcb225453 /lib/PublicInbox/V2Writable.pm
parentd792a6e8029e4fe56977c5c5d76bae8fe8836cc4 (diff)
downloadpublic-inbox-58e764d179131b0fba8590915e2528248be26329.tar.gz
This will be used to index and search Inbox objects and perhaps
individual git repositories/epochs for grokmirror manifest.js.gz
generation.  There is no sharding planned for this at the moment
since inbox count should remain low (~100K to 1M) compared to
message count.

Folding this into the existing sharded DBs could be possible;
but would likely increase query and maintenance costs, as well
as development complexity.  So we'll use a few more inodes and
FDs at runtime, instead.
Diffstat (limited to 'lib/PublicInbox/V2Writable.pm')
-rw-r--r--lib/PublicInbox/V2Writable.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm
index ba7cef13..afba0220 100644
--- a/lib/PublicInbox/V2Writable.pm
+++ b/lib/PublicInbox/V2Writable.pm
@@ -631,6 +631,9 @@ sub checkpoint ($;$) {
                         $_->shard_commit for @$shards;
                 }
 
+                my $midx = $self->{midx}; # misc index
+                $midx->commit_txn if $midx;
+
                 # last_commit is special, don't commit these until
                 # Xapian shards are done:
                 $dbh->begin_work if $dbh;
@@ -639,6 +642,7 @@ sub checkpoint ($;$) {
                         $dbh->commit;
                         $dbh->begin_work;
                 }
+                $midx->begin_txn if $midx;
         }
         $self->{total_bytes} += $self->{transact_bytes};
         $self->{transact_bytes} = 0;
@@ -678,6 +682,7 @@ sub done {
         }
         eval { $self->{oidx}->dbh_close };
         $err .= "over close: $@\n" if $@;
+        delete $self->{midx};
         delete $self->{bnote};
         my $nbytes = $self->{total_bytes};
         $self->{total_bytes} = 0;