From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-2.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id C738C1F54E for ; Wed, 20 Jul 2022 01:42:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241750AbiGTBmr (ORCPT ); Tue, 19 Jul 2022 21:42:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241774AbiGTBma (ORCPT ); Tue, 19 Jul 2022 21:42:30 -0400 Received: from ciao.gmane.io (ciao.gmane.io [116.202.254.214]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11EC63C8C2 for ; Tue, 19 Jul 2022 18:40:29 -0700 (PDT) Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1oDyhO-0005TG-4U for git@vger.kernel.org; Wed, 20 Jul 2022 03:40:26 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: git@vger.kernel.org From: Gregory Szorc Subject: Re: Race condition between repack and loose-objects maintenance task Date: Tue, 19 Jul 2022 18:40:19 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Cc: git@vger.kernel.org, stolee@gmail.com Content-Language: en-US In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On 6/29/2022 8:23 PM, Taylor Blau wrote: > On Wed, Jun 29, 2022 at 11:19:09PM -0400, Taylor Blau wrote: >>> However, I think there is yet another bug at play: running >>> `incremental-repack` appears to be able to repack the cruft packfile. >>> In doing so, it deletes its .mtimes file and the metadata inside. >> >> That sounds like a bug to me. I'll take a look into it and see what I >> can find. > > I actually think that there are two bugs here. > > One is that we run a MIDX repack and expire, which could lead to us > repacking the entire contents of the cruft pack and then expiring the > metadata file. This is a bug, and we should exclude cruft packs from > this computation. > > Another bug can happen when the cruft pack gets written into the MIDX > and is MIDX-expireable (meaning that no objects are selected from the > cruft pack). In that case, the `git multi-pack-index expire` step would > remove the cruft pack entirely, which is also incorrect. > > I'll take a look at fixing both of these, and thanks for pointing them > out! For posterity, when I disabled cruft packfiles after having it enabled for a few weeks, the next `git gc` invocation on a high traffic repo resulted in >100k loose objects/files being created before they were summarily deleted by the GC's prune. This is significantly greater than the unreferenced object creation rate of the underlying repo. So it appears as if the MIDX stripping of the cruft packfile mtimes effectively disabled pruning, leading to a build-up of unreferenced objects. Fortunately I hadn't deployed cruft packfiles to production. If I had, the excessive filesystem churn on NFS would have caused an incident due to degraded performance. Since the interaction between cruft packfiles and MIDX appears to be buggy, I think I'm going to leave cruft packfiles disabled until these features work better together.