From: Martin Fick <mfick@codeaurora.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: Michael Haggerty <mhagger@alum.mit.edu>,
Jeff King <peff@peff.net>,
git@vger.kernel.org
Subject: Re: Lockless Refs?
Date: Fri, 28 Dec 2012 18:07:23 -0700 [thread overview]
Message-ID: <201212281807.23533.mfick@codeaurora.org> (raw)
In-Reply-To: <7vlicijepv.fsf@alter.siamese.dyndns.org>
On Friday, December 28, 2012 09:58:36 am Junio C Hamano
wrote:
> Martin Fick <mfick@codeaurora.org> writes:
> > 3) To create a ref, it must be renamed from the null
> > file (sha 0000...) to the new value just as if it were
> > being updated from any other value, but there is one
> > extra condition: before renaming the null file, a full
> > directory scan must be done to ensure that the null
> > file is the only file in the directory...
>
> While you are scanning this directory to make sure it is
> empty,
The objective is not to scan for an empty dir, but to scan
for the existence of only the null file.
> I am contemplating to create the same ref with a
> different value. You finished checking but haven't
> created the null.
The scan needs to happen after creating the null, not before,
so I don't believe the rest of the scenario below is possible
then?
> I have also scanned, created the null
> and renamed it to my value. Now you try to create the
> null, succeed, and then rename. We won't know which of
> the two non-null values are valid, but worse yet, I think
> one of them should have failed in the first place.
> Sounds like we would need some form of locking around
> here. Is your goal "no locks", or "less locks"?
(answered below)
> > I don't know how this new scheme could be made to work
> > with the current scheme,...
>
> It is much more important to know if/why yours is better
> than the current scheme in the first place.
The goal is: "no locks which do not have a clearly defined
reliable recovery procedure".
Stale locks without a reliable recovery procedure will lead
to stolen locks. At this point it is only a matter of luck
whether this leads to data loss or not. So I do hope to
convince people first that the current scheme is bad, not that
my scheme is better! My scheme was proposed to get people
thinking that we may not have to use locks to get reliable
updates.
> Without an
> analysis on how the new scheme interacts with the packed
> refs and gives better behaviour, that is kinda difficult.
Fair enough. I will attempt this if the basic idea seems at
least sane? I do hope that eventually the packed-refs piece
and its locking will be reconsidered also; as Michael pointed
out it has issues already. So, I am hoping to get people
thinking more about lockless approaches to all the pieces. I
think I have some solutions to some of the other pieces also,
but I don't want to overwhelm the discussion all at once
(especially if my first piece is shown to be flawed, or if no
one has any interest in eliminating the current locks?)
> I think transition plans can wait until that is done. If
> it is not even marginally better, we do not have to worry
> about transitioning at all. If it is only marginally
> better, the transition has to be designed to be no impact
> to the existing repositories. If it is vastly better, we
> might be able to afford a flag day.
OK, makes sense, I jumped the gun a bit,
-Martin
next prev parent reply other threads:[~2012-12-29 1:07 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-21 8:04 [PATCH] refs: do not use cached refs in repack_without_ref Jeff King
2012-12-26 8:24 ` Michael Haggerty
2012-12-27 23:11 ` Lockless Refs? (Was [PATCH] refs: do not use cached refs in repack_without_ref) Martin Fick
2012-12-28 14:50 ` Martin Fick
2012-12-28 17:15 ` Lockless Refs? Junio C Hamano
2012-12-29 8:16 ` Jeff King
2012-12-29 21:15 ` Martin Fick
2012-12-29 8:12 ` Lockless Refs? (Was [PATCH] refs: do not use cached refs in repack_without_ref) Jeff King
2012-12-29 21:29 ` Martin Fick
2012-12-28 16:58 ` Lockless Refs? Junio C Hamano
2012-12-29 1:07 ` Martin Fick [this message]
2012-12-29 8:10 ` Lockless Refs? (Was [PATCH] refs: do not use cached refs in repack_without_ref) Jeff King
2012-12-29 22:18 ` Martin Fick
2012-12-30 17:03 ` Martin Fick
2012-12-31 10:30 ` Martin Fick
2013-01-03 23:52 ` Martin Fick
2013-01-04 17:52 ` Pyeron, Jason J CTR (US)
2013-01-04 18:01 ` Martin Fick
2013-01-04 21:28 ` Lockless Refs? Junio C Hamano
2013-01-05 16:12 ` Lockless Refs? (Was [PATCH] refs: do not use cached refs in repack_without_ref) Jeff King
2013-01-22 4:31 ` Drew Northup
2012-12-29 7:16 ` [PATCH] refs: do not use cached refs in repack_without_ref Jeff King
[not found] ` <201301071109.12086.mfick@codeaurora.org>
2013-01-07 18:14 ` Martin Fick
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=201212281807.23533.mfick@codeaurora.org \
--to=mfick@codeaurora.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=mhagger@alum.mit.edu \
--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).