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

Re: Re* Protecting old temporary objects being reused from concurrent "git gc"?

From
Jeff King <peff@peff.net>
Date
Nov 17, 2016, 01:43 UTC
Message-ID
<20161117014306.2ptqd56gur7dlb4c@sigill.intra.peff.net>
In-Reply-To
<xmqqvavmopl8.fsf_-_@gitster.mtv.corp.google.com>
On Wed, Nov 16, 2016 at 05:35:47PM -0800, Junio C Hamano wrote:
Show 9 quoted lines
> OK, here is what I have queued.
> 
> -- >8 --
> Subject: cache-tree: make sure to "touch" tree objects the cache-tree records
> 
> The cache_tree_fully_valid() function is called by callers that want
> to know if they need to call cache_tree_update(), i.e. as an attempt
> to optimize. They all want to have a fully valid cache-tree in the
> end so that they can write a tree object out.

That makes sense. I was focusing on cache_tree_update() call, but we do not even get there in the fully-valid case.

So I think this approach is nice as long as there is not a caller who asks "are we fully valid? I do not need to write, but was just wondering". That should be a read-only operation, but the freshen calls may fail with EPERM, for example.

I do not see any such callers, nor do I really expect any. Just trying to think through the possible consequences.

Show 6 quoted lines
> Strictly speaking, freshing these tree objects at each and every
> level is probably unnecessary, given that anything reachable from a
> young object inherits the youth from the referring object to be
> protected from pruning.  It should be sufficient to freshen only the
> very top-level tree instead.  Benchmarking and optimization is left
> as an exercise for later days.
Good observation, and nicely explained all around.
-Peff
Previous: Junio C Hamano
Message 13 of 13 in “Protecting old temporary objects being reused from concurrent "git gc"?”
  1. Matt McCutchenNov 15, 2016
  2. Jeff KingNov 15, 2016
  3. Matt McCutchenNov 15, 2016
  4. Jeff KingNov 15, 2016
  5. git-gc.txt: expand discussion of races with other processesMatt McCutchen, Nov 15, 2016
  6. Matt McCutchenNov 15, 2016
  7. Junio C HamanoNov 15, 2016
  8. Jeff KingNov 16, 2016
  9. Junio C HamanoNov 16, 2016
  10. Junio C HamanoNov 16, 2016
  11. Jeff KingNov 17, 2016
  12. Re* Protecting old temporary objects being reused from concurrent "git gc"?Junio C Hamano, Nov 17, 2016
  13. Jeff KingNov 17, 2016

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.