From: Elijah Newren <newren@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jeff King <peff@peff.net>, Neeraj Singh <nksingh85@gmail.com>,
Git Mailing List <git@vger.kernel.org>,
Jonathan Nieder <jrnieder@gmail.com>
Subject: Re: What's cooking in git.git (Sep 2021, #08; Mon, 27)
Date: Fri, 1 Oct 2021 16:05:38 -0700 [thread overview]
Message-ID: <CABPp-BG9JNeFJ_gzepntcieJAMzT1OKNes9zEOiWY3JMXh4BMg@mail.gmail.com> (raw)
In-Reply-To: <xmqqr1d42ykj.fsf@gitster.g>
On Fri, Oct 1, 2021 at 3:02 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> 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?
> 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/
next prev parent reply other threads:[~2021-10-01 23:05 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-28 0:52 What's cooking in git.git (Sep 2021, #08; Mon, 27) Junio C Hamano
2021-09-28 1:57 ` Ævar Arnfjörð Bjarmason
2021-09-28 20:52 ` Junio C Hamano
2021-09-28 6:46 ` Elijah Newren
2021-09-28 7:45 ` Ævar Arnfjörð Bjarmason
2021-09-28 17:25 ` Junio C Hamano
2021-09-28 21:00 ` Neeraj Singh
2021-09-28 23:34 ` Junio C Hamano
2021-09-28 23:53 ` Neeraj Singh
2021-10-07 22:01 ` Junio C Hamano
2021-10-08 6:51 ` Elijah Newren
2021-10-08 22:30 ` Neeraj Singh
2021-10-08 23:01 ` Junio C Hamano
2021-09-28 8:07 ` Ævar Arnfjörð Bjarmason
2021-09-28 17:27 ` Junio C Hamano
2021-09-28 13:31 ` Derrick Stolee
2021-09-28 17:33 ` Junio C Hamano
2021-09-28 20:16 ` Derrick Stolee
2021-09-28 17:16 ` Junio C Hamano
2021-09-29 6:42 ` Elijah Newren
2021-09-28 23:40 ` Jeff King
2021-09-28 23:49 ` Jeff King
2021-09-29 18:43 ` Neeraj Singh
2021-09-30 8:16 ` Jeff King
2021-10-01 7:50 ` Elijah Newren
2021-10-01 17:02 ` Junio C Hamano
2021-10-01 17:39 ` Neeraj Singh
2021-10-01 18:15 ` Elijah Newren
2021-10-01 18:12 ` Elijah Newren
2021-10-01 22:02 ` Junio C Hamano
2021-10-01 23:05 ` Elijah Newren [this message]
2021-10-04 13:45 ` Elijah Newren
2021-09-28 8:22 ` da/difftool (was: Re: What's cooking in git.git (Sep 2021, #08; Mon, 27)) Ævar Arnfjörð Bjarmason
2021-09-28 8:23 ` ns/batched-fsync & en/remerge-diff (was " Ævar Arnfjörð Bjarmason
2021-09-28 8:31 ` sg/test-split-index-fix " Ævar Arnfjörð Bjarmason
2021-09-28 8:35 ` hn/reftable (Re: " Ævar Arnfjörð Bjarmason
2021-09-28 12:18 ` Han-Wen Nienhuys
2021-09-30 5:06 ` Carlo Arenas
2021-09-29 8:12 ` What's cooking in git.git (Sep 2021, #08; Mon, 27) Fabian Stelzer
2021-09-30 21:26 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CABPp-BG9JNeFJ_gzepntcieJAMzT1OKNes9zEOiWY3JMXh4BMg@mail.gmail.com \
--to=newren@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jrnieder@gmail.com \
--cc=nksingh85@gmail.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).