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

Re: [PATCH 0/3] commit-graph: fix corruption during generation v2 upgrade

From
Derrick Stolee <derrickstolee@github.com>
Date
Jul 15, 2022, 03:20 UTC
Message-ID
<14325f93-051a-c286-9dc4-1a2762554a27@github.com>
In-Reply-To
<cover.1657667404.git.me@ttaylorr.com>
On 7/12/2022 7:10 PM, Taylor Blau wrote:
Show 16 quoted lines
> This brief series resolves a bug where a commit-graph would become
> corrupt when upgrading from generation number v1 to v2, as originally
> reported in [1].
> 
> Some speculation occurred as to what might be causing that bug in the
> thread beginning at [1], until the problem was explained in more detail
> by Will Chandler in [2].
> 
> The crux of the issue, as is described in [2] and [3], is that the
> commit_graph_data slab is reused for read and write operations involving
> the commit-graph, leading to situations where data computed in
> preparation of a write is clobbered by a read of existing data.
> 
> The first patch demonstrates the issue, and the second patch prepares to
> fix it by introducing a helper function. The crux of the issue is
> described and fixed in the third patch.

Thanks, all, for identifying the scenario that causes this breakage. It was frustrating that we had reports of corruption without knowing where it was coming from.

This solution looks like the best we can do right now, although it hints that some refactoring would be good to distinguish between "commits as read" and "commits to be written" during this upgrade phase. Something to think about, but not to block this fix.

Thanks, -Stolee

Previous: Taylor Blau
Message 12 of 12 in “commit-graph: fix corruption during generation v2 upgrade”
  1. 0/3 commit-graph: fix corruption during generation v2 upgradeTaylor Blau, Jul 12, 2022
  2. 1/3 t5318: demonstrate commit-graph generation v2 corruptionTaylor Blau, Jul 12, 2022
  3. Derrick StoleeJul 15, 2022
  4. Taylor BlauJul 15, 2022
  5. Junio C HamanoJul 16, 2022
  6. Taylor BlauJul 16, 2022
  7. 2/3 commit-graph: introduce `repo_find_commit_pos_in_graph()`Taylor Blau, Jul 12, 2022
  8. Derrick StoleeJul 15, 2022
  9. 3/3 commit-graph: fix corrupt upgrade from generation v1 to v2Taylor Blau, Jul 12, 2022
  10. Junio C HamanoJul 13, 2022
  11. Taylor BlauJul 15, 2022
  12. Derrick StoleeJul 15, 2022

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.