diff options
-rw-r--r-- | lib/PublicInbox/SearchIdxPart.pm | 1 | ||||
-rw-r--r-- | lib/PublicInbox/V2Writable.pm | 13 |
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/PublicInbox/SearchIdxPart.pm b/lib/PublicInbox/SearchIdxPart.pm index 6025fc40..2f577ecf 100644 --- a/lib/PublicInbox/SearchIdxPart.pm +++ b/lib/PublicInbox/SearchIdxPart.pm @@ -45,6 +45,7 @@ sub partition_worker_loop ($$$) { if ($line eq "commit\n") { $xdb->commit_transaction if $txn; $txn = undef; + $self->{skeleton}->remote_commit; } elsif ($line eq "close\n") { $self->_xdb_release; $xdb = $txn = undef; diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm index ff3b6573..73110ff0 100644 --- a/lib/PublicInbox/V2Writable.pm +++ b/lib/PublicInbox/V2Writable.pm @@ -131,22 +131,21 @@ sub searchidx_checkpoint { # order matters, we can only close {skel} after all partitions # are done because the partitions also write to {skel} - if (my $parts = $self->{idx_parts}) { foreach my $idx (@$parts) { - $idx->remote_commit; + $idx->remote_commit; # propagates commit to skel $idx->remote_close unless $more; } delete $self->{idx_parts} unless $more; } if (my $skel = $self->{skel}) { - $skel->{mm}->{dbh}->commit; + my $dbh = $skel->{mm}->{dbh}; + $dbh->commit; if ($more) { - $skel->{mm}->{dbh}->begin_work; - } - $skel->remote_commit; - unless ($more) { + $dbh->begin_work; + } else { + $skel->remote_commit; # XXX should be unnecessary... $skel->remote_close; delete $self->{skel}; } |