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

Re: [PATCH 2/3] path-walk: fix setup of pending objects

From
Derrick Stolee <stolee@gmail.com>
Date
Aug 21, 2025, 12:55 UTC
Message-ID
<9263e8f7-8772-4b8a-a3f2-6ca2a70d645d@gmail.com>
In-Reply-To
<aKbSTN-rfGzadPsm@pks.im>
On 8/21/2025 4:01 AM, Patrick Steinhardt wrote:
> On Wed, Aug 20, 2025 at 03:42:11PM -0400, Derrick Stolee wrote:
>> On 8/20/2025 3:02 PM, Junio C Hamano wrote:
>>> "Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 13 quoted lines
>> The key integration point is the "pending" list operating a bit
>> different from walking directly from tags or commits. I was trying
>> to reproduce the issue from all of those other sources before unlocking
>> the "singleton" nature of the problem, and failed to do so.
>>
>> The resolve-undo cache (REUC) is something that I had not tested
>> previously. Adding "git rm --cached x/y" to the test in the previous
>> case leads to the 'git fsck' call giving a "dangling blob" warning,
>> so that could be an interesting way to strengthen the test. Thanks,
> 
> I also wonder a bit about the future -- if we ever add a new source for
> pending objects, would the author have to amend "path-walk.c" to take
> this new pending source into account?

I don't think the risk comes from new ways to add pending objects, but that the path-walk algorithm added an "optimization" without appropriately modifying how it handled the pending objects. New sources of pending objects shouldn't cause any issues, unless the revision API itself changed substantially.

For example, in my draft for v2 I add changes to my test to account for the REUC in the repack. The new logic for the path-walk feature worked just fine. It does point out that 'git fsck' doesn't follow links in the REUC and so reports the blob as dangling.

If we have a new source for pending objects in the context of pack-objects or repack, one would hope that tests would be added to demonstrate the behavior and then that could be double-checked with GIT_TEST_PACK_PATH_WALK=1. One problem in this situation is that the tests were not substantial enough for these sources. We are correcting for that now.

> I guess the answer is "yes", which does make me feel a bit uneasy as
> it is very easy to now corrupt the repository.

Perhaps this has always been very easy to make a bug that leads to losing objects, but we're purposefully wary to touch the logic around the repacking processes.

One feature that could provide increased confidence is some step that double-checks the object list before and after a step like this to make sure that no objects are dropped (or only the set we expect is dropped). Something like comparing the object lists in the pack-indexes before and after a repack. This might be too problematic to enable in all cases, but could be enabled in the test suite and certain critical places. Azure DevOps has something similar in its backend to prevent any change to the Git object database that can't be undone, but these steps happen asynchronously to "production data" so it may not be appropriate for all server architectures.

Thanks, -Stolee

Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 11 of 22 in “[2.51.0 Bug] Missing singleton objects in 'git repack -adf --path-walk'”
  1. 0/3 [2.51.0 Bug] Missing singleton objects in 'git repack -adf --path-walk'Derrick Stolee via GitGitGadget, Aug 20, 2025
  2. 1/3 t7700: add failing --path-walk testDerrick Stolee via GitGitGadget, Aug 20, 2025
  3. Patrick SteinhardtAug 21, 2025
  4. Derrick StoleeAug 21, 2025
  5. Junio C HamanoAug 21, 2025
  6. Elijah NewrenAug 21, 2025
  7. 2/3 path-walk: fix setup of pending objectsDerrick Stolee via GitGitGadget, Aug 20, 2025
  8. Junio C HamanoAug 20, 2025
  9. Derrick StoleeAug 20, 2025
  10. Patrick SteinhardtAug 21, 2025
  11. Derrick StoleeAug 21, 2025
  12. Patrick SteinhardtAug 21, 2025
  13. Derrick StoleeAug 21, 2025
  14. Elijah NewrenAug 21, 2025
  15. 3/3 path-walk: create initializer for path listsDerrick Stolee via GitGitGadget, Aug 20, 2025
  16. Elijah NewrenAug 21, 2025
  17. 0/2 [2.51.0 Bug] Missing singleton objects in 'git repack -adf --path-walk'Derrick Stolee via GitGitGadget, Aug 25, 2025
  18. 1/2 path-walk: fix setup of pending objectsDerrick Stolee via GitGitGadget, Aug 25, 2025
  19. 2/2 path-walk: create initializer for path listsDerrick Stolee via GitGitGadget, Aug 25, 2025
  20. Elijah NewrenAug 26, 2025
  21. Junio C HamanoAug 26, 2025
  22. Patrick SteinhardtSep 2, 2025

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.