From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS6315 166.70.0.0/16 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.1 Received: from out01.mta.xmission.com (out01.mta.xmission.com [166.70.13.231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id D5C1E1F597; Thu, 2 Aug 2018 12:08:11 +0000 (UTC) Received: from in02.mta.xmission.com ([166.70.13.52]) by out01.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1flCOo-0000xN-8A; Thu, 02 Aug 2018 06:08:10 -0600 Received: from [97.119.167.31] (helo=x220.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1flCOn-00036V-7y; Thu, 02 Aug 2018 06:08:10 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Eric Wong Cc: meta@public-inbox.org References: <878t5qkpis.fsf@xmission.com> <20180801164344.7911-8-ebiederm@xmission.com> <20180802030022.ly2tvbobs7tkfmn3@whir> Date: Thu, 02 Aug 2018 07:08:04 -0500 In-Reply-To: <20180802030022.ly2tvbobs7tkfmn3@whir> (Eric Wong's message of "Thu, 2 Aug 2018 03:00:22 +0000") Message-ID: <87in4tj7iz.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1flCOn-00036V-7y;;;mid=<87in4tj7iz.fsf@xmission.com>;;;hst=in02.mta.xmission.com;;;ip=97.119.167.31;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX197OviI3dlf3s/1+tLihOdrDd13TzDW+Vs= X-SA-Exim-Connect-IP: 97.119.167.31 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: Re: [PATCH 08/13] Msgmap.pm: Track the largest value of num ever assigned X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) List-Id: Eric Wong writes: > "Eric W. Biederman" wrote: >> --- a/lib/PublicInbox/Msgmap.pm >> +++ b/lib/PublicInbox/Msgmap.pm >> @@ -51,6 +51,10 @@ sub new_file { >> $dbh->begin_work; >> $self->created_at(time) unless $self->created_at; >> $dbh->commit; >> + >> + my (undef, $max) = $self->minmax(); >> + $max ||= 0; >> + $self->num_highwater($max); > > I think the calls to minmax and num_highwater should be in the > transaction right above it. I can squash locally if that's the > only thing... Sounds good. With autocommit being on by default and repository locking happening I was not at all certain where transaction boundaries need to go (or if they are really needed). But by it's very nature num_highwater needs to be in the same transaction as whatever adds a new higher number into msgmap. > Everything else looks good, so far; thanks. Eric