git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Warnings in gc.log can prevent gc --auto from running

From
Jeff King <peff@peff.net>
Date
Jul 29, 2019, 10:07 UTC
Message-ID
<20190729100745.GA2755@sigill.intra.peff.net>
In-Reply-To
<qhdnuh$5m5r$1@blaine.gmane.org>
On Thu, Jul 25, 2019 at 07:18:57PM -0700, Gregory Szorc wrote:
Show 7 quoted lines
> I think I've found some undesirable behavior with regards to the
> behavior of `git gc --auto`. The tl;dr is that a warning message written
> to gc.log can result in `git gc --auto` effectively disabling itself for
> gc.logExpiry. The problem is easier to trigger in 2.22 as a result of
> enabling bitmap indices for bare repositories by default and the
> behavior can easily result in performance degradation, especially on
> servers.
Yuck, thanks for reporting this.

As you note, this is a special case of a much larger problem. The other common case is the "oops, you still have a lot of loose objects after repacking" warning. There's more discussion and some patches here:

  https://public-inbox.org/git/20180716172717.237373-1-jonathantanmy@google.com/

though I don't think any of the work that came out of that fundamentally solves the issue.

Show 5 quoted lines
> I don't prescribe to know the best way to solve this problem. I just
> know it is a footgun sitting in the default Git configuration. And the
> footgun became a lot easier to fire with the introduction of warning
> messages related to bitmap indices and again when bitmap indices were
> enabled by default for bare repositories in Git 2.22.

IMHO one way to mitigate this is to simply warn less. In particular, if we are auto-enabling bitmaps, then it doesn't necessarily make sense for us to warn about them being disabled.

In the case of .keep files, we've already got 7328482253 (repack: disable bitmaps-by-default if .keep files exist, 2019-06-29), which should be in the next released version of Git. But I suspect that's racy with respect to somebody creating .keep files, and as you note there are other config options that might prevent us from generating bitmaps.

Instead, it may make sense to turn the --write-bitmap-index option of pack-objects into a tri-state: true/false/auto. Then pack-objects would know that we are in best-effort mode, and would avoid warning in that case. That would also let git-repack express its intentions better to git-pack-objects, so we could replace 7328482253, and keep more of the logic in pack-objects, which is ultimately what has to make the decision about whether it can generate bitmaps.

-Peff
Previous: Gregory SzorcNext: Ævar Arnfjörð Bjarmason
Message 2 of 11 in “Warnings in gc.log can prevent gc --auto from running”
  1. Gregory SzorcJul 26, 2019
  2. Jeff KingJul 29, 2019
  3. Ævar Arnfjörð BjarmasonJul 29, 2019
  4. Jeff KingJul 31, 2019
  5. 0/3 handling warnings due to auto-enabled bitmapsJeff King, Jul 31, 2019
  6. 1/3 t7700: clean up .keep file in bitmap-writing testJeff King, Jul 31, 2019
  7. 2/3 repack: silence warnings when auto-enabled bitmaps cannot be builtJeff King, Jul 31, 2019
  8. Junio C HamanoJul 31, 2019
  9. Jeff KingJul 31, 2019
  10. 3/3 repack: simplify handling of auto-bitmaps and .keep filesJeff King, Jul 31, 2019
  11. Junio C HamanoJul 31, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.