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

Re: [PATCH 4/4] get_oid(): when an object was not found, try harder

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 14, 2019, 04:05 UTC
Message-ID
<xmqqzhpy9k40.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20190314024023.GA3889@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> I'm not sure it's really worth addressing (just because I don't think
> there's a good way to do it that isn't expensive).
I do not think so, either.  Not at this layer, anyway.

If a "-x" command newly created an object whose prefix makes it ambiguous against an existing object, we would not notice, unless we refresh the loose object cache, that we now have two objects that share the prefix. And we will find an object (the older one) with the prefix in the stale cache without hitting "oh we do not find it, let's retry" codepath. So to solve both sides of the coin, we'd need invalidation either way, which obviously defeats the whole caching concept, doesn't it?

But when we know we are running things like interactive rebase with "-x" that (1) creates new objects while we are waiting for that process to finish and (2) not performance critical, the loop that drives these steps can flush any cache after seeing an external process to return control to us. Such an approach would still not solve the issue a totally unrelated "repack" process creates by mucking with the object database behind our back, but at least the damage to the code is much better isolated ;-)

Previous: Jeff KingNext: Jeff King
Message 20 of 32 in “get_oid: cope with a possibly stale loose object cache”
  1. 0/4 get_oid: cope with a possibly stale loose object cacheJohannes Schindelin via GitGitGadget, Mar 13, 2019
  2. 1/4 rebase -i: demonstrate obscure loose object cache bugJohannes Schindelin via GitGitGadget, Mar 13, 2019
  3. Ævar Arnfjörð BjarmasonMar 13, 2019
  4. Jeff KingMar 13, 2019
  5. Jeff KingMar 13, 2019
  6. Johannes SchindelinMar 13, 2019
  7. Jeff KingMar 14, 2019
  8. Johannes SchindelinMar 13, 2019
  9. Jeff KingMar 14, 2019
  10. Johannes SixtMar 14, 2019
  11. Johannes SchindelinMar 14, 2019
  12. Junio C HamanoMar 14, 2019
  13. Johannes SchindelinMar 14, 2019
  14. 2/4 sequencer: improve error message when an OID could not be parsedJohannes Schindelin via GitGitGadget, Mar 13, 2019
  15. Junio C HamanoMar 14, 2019
  16. 4/4 get_oid(): when an object was not found, try harderJohannes Schindelin via GitGitGadget, Mar 13, 2019
  17. Junio C HamanoMar 14, 2019
  18. Jeff KingMar 14, 2019
  19. Jeff KingMar 14, 2019
  20. Junio C HamanoMar 14, 2019
  21. Jeff KingMar 14, 2019
  22. Junio C HamanoMar 14, 2019
  23. Johannes SchindelinMar 14, 2019
  24. Jeff KingMar 14, 2019
  25. Johannes SchindelinMar 14, 2019
  26. 3/4 sequencer: move stale comment into correct locationJohannes Schindelin via GitGitGadget, Mar 13, 2019
  27. Jeff KingMar 13, 2019
  28. 0/4 get_short_oid: cope with a possibly stale loose object cacheJohannes Schindelin via GitGitGadget, Mar 14, 2019
  29. 1/4 rebase -i: demonstrate obscure loose object cache bugJohannes Schindelin via GitGitGadget, Mar 14, 2019
  30. 2/4 sequencer: improve error message when an OID could not be parsedJohannes Schindelin via GitGitGadget, Mar 14, 2019
  31. 3/4 sequencer: move stale comment into correct locationJohannes Schindelin via GitGitGadget, Mar 14, 2019
  32. 4/4 get_oid(): when an object was not found, try harderJohannes Schindelin via GitGitGadget, Mar 14, 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.