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 19E4A1F44D for ; Tue, 16 Apr 2024 20:47:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1713300449; bh=o/X/YGnCPDz932lXgDbQgDP7McV9Hif5HPHV4kiuM+I=; h=From:To:Subject:Date:From; b=0ebvHCG3F/te0MnqB1qDHm4Yuqsi+Xj4EhrM9M+P8GbmtB+MYqH0AJ8gjoZE1Qa8k iIKGw+AqGJ7h8ycrjm+/rSu7BVWezTfDgl9TP96S4J+8Gg3F+cACTJMRqsZ48gtmLH RmvyRr664OFoiL9hr2UYSZQSGc7gHa4Rxc5e4Lpk= From: Eric Wong To: spew@80x24.org Subject: [PATCH 1/4] v2 + lei/store: always wait for fast-import checkpoint Date: Tue, 16 Apr 2024 20:47:25 +0000 Message-ID: <20240416204728.3609009-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};