From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 0F44F1F461 for ; Tue, 16 Apr 2024 20:56:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1713300990; bh=o/X/YGnCPDz932lXgDbQgDP7McV9Hif5HPHV4kiuM+I=; h=From:To:Subject:Date:In-Reply-To:References:From; b=veEfxyujdPvVOWFHNoDyUF7TTyLk/lKd58RGLbia18AT2INp5wQJKh/nW/sLNqc9I ZqnyGVytMU3l9kcaPy8okAwyKKPPzmAS3eqfPT+uha8bbTCUuCWDKIyHm7lxCfYqaj UepkKTzcvvVTQO1iIaxAsI86KjiVZAWA061f/EFY= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/4] v2 + lei/store: always wait for fast-import checkpoint Date: Tue, 16 Apr 2024 20:56:26 +0000 Message-ID: <20240416205629.3648894-2-e@80x24.org> In-Reply-To: <20240416205629.3648894-1-e@80x24.org> References: <20240416205629.3648894-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Since data going to git is the most important, always ensure data is written to git before attempting to write anything to SQLite or Xapian. --- lib/PublicInbox/LeiStore.pm | 4 +--- lib/PublicInbox/V2Writable.pm | 8 +------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm index 2eb09eca..0df2352c 100644 --- a/lib/PublicInbox/LeiStore.pm +++ b/lib/PublicInbox/LeiStore.pm @@ -573,9 +573,7 @@ sub set_xvmd { sub checkpoint { my ($self, $wait) = @_; - if (my $im = $self->{im}) { - $wait ? $im->barrier : $im->checkpoint; - } + $self->{im}->barrier if $self->{im}; delete $self->{lms}; $self->{priv_eidx}->checkpoint($wait); } diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm index fb259396..43f37f60 100644 --- a/lib/PublicInbox/V2Writable.pm +++ b/lib/PublicInbox/V2Writable.pm @@ -507,13 +507,7 @@ sub set_last_commits ($) { # this is NOT for ExtSearchIdx sub checkpoint ($;$) { my ($self, $wait) = @_; - if (my $im = $self->{im}) { - if ($wait) { - $im->barrier; - } else { - $im->checkpoint; - } - } + $self->{im}->barrier if $self->{im}; my $shards = $self->{idx_shards}; if ($shards) { my $dbh = $self->{mm}->{dbh} if $self->{mm};