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

Re: Two issues with mark_reachable_objects

From
Jeff King <peff@peff.net>
Date
Apr 27, 2021, 15:13 UTC
Message-ID
<YIgqIiCeiTISIio1@coredump.intra.peff.net>
In-Reply-To
<YIgijn93f639Pp7Z@coredump.intra.peff.net>
On Tue, Apr 27, 2021 at 10:41:18AM -0400, Jeff King wrote:
Show 11 quoted lines
> I think we'd just want to run the whole mark_recent block after doing
> the bitmap traversal.
> 
> There may be some subtlety with reusing the rev_info struct again. I
> think we'd want to reset the pending objects list after calling into the
> bitmap code. It _usually_ does an actual traversal that consumes the
> list, but not necessarily. I think traverse_bitmap_commit_list()
> probably ought to be the one to do it, so it behaves more like
> traverse_commit_list(). (OTOH, I don't think it's _too_ bad if we don't;
> we'd include those already-seen objects in our traversal, but they
> should all by definition have the SEEN bit set, so we'd stop there).

Nope, I was wrong here. It's actually prepare_bitmap_walk() which would want to clear the pending list, and it does so (it may later re-add objects in find_objects(), but if it does so, it will definitely traverse and consume them).

Show 5 quoted lines
> It's possible that we could do the second mark_recent traversal also
> with bitmaps (but still separately). I can't offhand think of a reason
> that ignore_missing_links wouldn't behave well there. But since we
> expect it to be small, I'd be more comfortable just using the regular
> traversal code.

I poked at this a bit, and indeed, the bitmap code is not ready to handle the caller passing ignore_missing_links (it performs two separate traversals for the wanted and uninteresting objects, and manipulates ignore_missing_links itself between the two). It would probably be easy to change, but I think we should focus on the minimal fix for the bug you found first.

-Peff
Previous: Jeff KingNext: Jeff King
Message 3 of 10 in “Two issues with mark_reachable_objects”
  1. David EmettApr 27, 2021
  2. Jeff KingApr 27, 2021
  3. Jeff KingApr 27, 2021
  4. prune: save reachable-from-recent objects with bitmapsJeff King, Apr 27, 2021
  5. David EmettApr 28, 2021
  6. Jeff KingApr 28, 2021
  7. 0/2 prune: save reachable-from-recent objects with bitmapsJeff King, Apr 28, 2021
  8. 1/2 pack-bitmap: clean up include_check after useJeff King, Apr 28, 2021
  9. 2/2 prune: save reachable-from-recent objects with bitmapsJeff King, Apr 28, 2021
  10. Junio C HamanoApr 29, 2021

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.