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

Re: What's cooking in git.git (Sep 2021, #08; Mon, 27)

From
Elijah Newren <newren@gmail.com>
Date
Oct 1, 2021, 23:05 UTC
Message-ID
<CABPp-BG9JNeFJ_gzepntcieJAMzT1OKNes9zEOiWY3JMXh4BMg@mail.gmail.com>
In-Reply-To
<xmqqr1d42ykj.fsf@gitster.g>
On Fri, Oct 1, 2021 at 3:02 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 15 quoted lines
>
> Elijah Newren <newren@gmail.com> writes:
>
> > So with that out of the way, let's return to discussing the textconv
> > cache.  If the remerge-diff results aren't cached, isn't it unsafe to
> > allow the textconv cache to persist anything while remerge-diff is
> > running because it could create corruption?
>
> I do not think anybody involved in this thread thinks it is
> practical to annotate each write_object_file() with "this is
> temporary" vs "this is to persist", so it is a given that it would
> be all-or-none.  If we want write_object_file() called while we are
> running remerge-diff to write to a temporary object store, we have
> to accept any other write_object_file() called by somebody else,
> like textconv cache, must become temporary.
Ok, good.

But is this write_object_file() specific? I think pretend_object_file() has the same problem where the textconv cache could reference a pretend_object_file() and thus write objects and/or refs that become corrupt. (In particular, if the userdiff fires on any of the new files created by the three-way content merges, then I think we hit the exact same problem) So, I think as long as there are any "temporary" objects being fed to diff, the textconv cache needs to also be considered temporary. Or am I misunderstanding something?

Show 6 quoted lines
> It may be sufficient to plug ref updates (which would cover the
> finialization of notes-cache used by the textconv cache) to avoid
> corruption, but that might give us a pointless and unpleasant error
> message, so it may be necessary to teach the notes-cache stuff to
> allow getting existing cached data while disabling it to accept
> cache updates.

All we need to do here is set the quarantine environment, as per Neeraj's report[1], it already handles all of this:

""" Peff's test case was invoking ref updates via the cachetextconv setting. That particular code silently does nothing when a ref update is forbidden """

Looking at the code, this appears to happen because ref_transaction_prepare() doesn't print an error in the quarantine environment, but returns one. That error is passed all the way up the stack to notes_cache_write() and then to fill_textconv(). fill_textconv() is the first level in the stack that ignores the return code of what it's calling, namely notes_cache_write(), which means that things work fine. There's even a comment a few lines stating, "ignore errors, as we might be in a readonly repository". So, I think we're good as long as we ensure the quarantine environment is setup.

[1] https://lore.kernel.org/git/20210929184339.GA19712@neerajsi-x1.localdomain/
Previous: Junio C HamanoNext: Elijah Newren
Message 31 of 40 in “What's cooking in git.git (Sep 2021, #08; Mon, 27)”
  1. Junio C HamanoSep 28, 2021
  2. Ævar Arnfjörð BjarmasonSep 28, 2021
  3. Junio C HamanoSep 28, 2021
  4. Elijah NewrenSep 28, 2021
  5. Ævar Arnfjörð BjarmasonSep 28, 2021
  6. Junio C HamanoSep 28, 2021
  7. Neeraj SinghSep 28, 2021
  8. Junio C HamanoSep 28, 2021
  9. Neeraj SinghSep 28, 2021
  10. Junio C HamanoOct 7, 2021
  11. Elijah NewrenOct 8, 2021
  12. Neeraj SinghOct 8, 2021
  13. Junio C HamanoOct 8, 2021
  14. Ævar Arnfjörð BjarmasonSep 28, 2021
  15. Junio C HamanoSep 28, 2021
  16. Derrick StoleeSep 28, 2021
  17. Junio C HamanoSep 28, 2021
  18. Derrick StoleeSep 28, 2021
  19. Junio C HamanoSep 28, 2021
  20. Elijah NewrenSep 29, 2021
  21. Jeff KingSep 28, 2021
  22. Jeff KingSep 28, 2021
  23. Neeraj SinghSep 29, 2021
  24. Jeff KingSep 30, 2021
  25. Elijah NewrenOct 1, 2021
  26. Junio C HamanoOct 1, 2021
  27. Neeraj SinghOct 1, 2021
  28. Elijah NewrenOct 1, 2021
  29. Elijah NewrenOct 1, 2021
  30. Junio C HamanoOct 1, 2021
  31. Elijah NewrenOct 1, 2021
  32. Elijah NewrenOct 4, 2021
  33. da/difftool (was: Re: What's cooking in git.git (Sep 2021, #08; Mon, 27))Ævar Arnfjörð Bjarmason, Sep 28, 2021
  34. ns/batched-fsync & en/remerge-diff (was Re: What's cooking in git.git (Sep 2021, #08; Mon, 27))Ævar Arnfjörð Bjarmason, Sep 28, 2021
  35. sg/test-split-index-fix (was Re: What's cooking in git.git (Sep 2021, #08; Mon, 27))Ævar Arnfjörð Bjarmason, Sep 28, 2021
  36. hn/reftable (Re: What's cooking in git.git (Sep 2021, #08; Mon, 27))Ævar Arnfjörð Bjarmason, Sep 28, 2021
  37. Han-Wen NienhuysSep 28, 2021
  38. Carlo ArenasSep 30, 2021
  39. Fabian StelzerSep 29, 2021
  40. Junio C HamanoSep 30, 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.