All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: David Turner <novalis@novalis.org>
Cc: "Junio C Hamano" <gitster@pobox.com>,
	git@vger.kernel.org, "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: Re: "disabling bitmap writing, as some objects are not being packed"?
Date: Fri, 16 Dec 2016 16:49:07 -0500	[thread overview]
Message-ID: <20161216214906.z53yp2x4n6hdc27m@sigill.intra.peff.net> (raw)
In-Reply-To: <1481924416.28176.19.camel@frank>

On Fri, Dec 16, 2016 at 04:40:16PM -0500, David Turner wrote:

> I would assume, based on the documentation, that auto gc would be doing
> an all-into-one repack:
> "If the number of packs exceeds the value of gc.autopacklimit, then
>  existing packs (except those marked with a .keep file) are
>  consolidated into a single pack by using the -A option of git
>  repack."
> 
> I don't have any settings that limit the size of packs, either.  And a
> manual git repack -a -d creates only a single pack.  Its loneliness
> doesn't last long, because pretty soon a new pack is created by an
> incoming push.

The interesting code is in need_to_gc():

        /*
         * If there are too many loose objects, but not too many
         * packs, we run "repack -d -l".  If there are too many packs,
         * we run "repack -A -d -l".  Otherwise we tell the caller
         * there is no need.
         */
        if (too_many_packs())
                add_repack_all_option();
        else if (!too_many_loose_objects())
                return 0;

So if you have (say) 10 packs and 10,000 objects, we'll incrementally
pack those objects into a single new pack.

I never noticed this myself because we do not use auto-gc at GitHub at
all. We only ever do a big all-into-one repack.

> Unless this just means that some objects are being kept loose (perhaps
> because they are unreferenced)? 

If they're unreferenced, they won't be part of the new pack. You might
accumulate loose objects that are ejected from previous packs, which
could trigger auto-gc to do an incremental pack (even though it wouldn't
be productive, because they're unreferenced!). You may also get them
from pushes (small pushes will be exploded into loose objects by
default).

-Peff

  reply	other threads:[~2016-12-16 21:49 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-16 21:05 "disabling bitmap writing, as some objects are not being packed"? David Turner
2016-12-16 21:27 ` Jeff King
2016-12-16 21:28 ` Junio C Hamano
2016-12-16 21:32   ` Jeff King
2016-12-16 21:40     ` David Turner
2016-12-16 21:49       ` Jeff King [this message]
2016-12-16 23:59         ` [PATCH] pack-objects: don't warn about bitmaps on incremental pack David Turner
2016-12-17  4:04           ` Jeff King
2016-12-19 16:03             ` David Turner
2016-12-17  7:50   ` "disabling bitmap writing, as some objects are not being packed"? Duy Nguyen
2017-02-08  1:03     ` David Turner
2017-02-08  6:45       ` Duy Nguyen
2017-02-08  8:24         ` David Turner
2017-02-08  8:37           ` Duy Nguyen
2017-02-08 17:44             ` Junio C Hamano
2017-02-08 19:05               ` David Turner
2017-02-08 19:08                 ` Jeff King
2017-02-08 22:14                   ` David Turner
2017-02-08 23:00                     ` Jeff King
2017-02-09  0:18                       ` Junio C Hamano
2017-02-09  1:12                         ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161216214906.z53yp2x4n6hdc27m@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=novalis@novalis.org \
    --cc=pclouds@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.