From: Martin Fick <mfick@codeaurora.org>
To: Earl Gresh <egresh@codeaurora.org>
Cc: git@vger.kernel.org
Subject: Re: Missing Refs after Garbage Collection
Date: Wed, 2 Jan 2013 15:43:07 -0700 [thread overview]
Message-ID: <201301021543.08029.mfick@codeaurora.org> (raw)
In-Reply-To: <C0A16EC8-D05A-41D0-BF2A-34BF3B1B839E@codeaurora.org>
On Friday, December 21, 2012 06:41:43 pm Earl Gresh wrote:
> Hi-
>
> I have observed that after running GC, one particular git
> repository ended up with some missing refs in the
> refs/changes/* namespace the Gerrit uses for storing
> patch sets. The refs were valid and should not have been
> pruned. Concerned about loosing data, GC is still enabled
> but ref packing is turned off. Now the number of refs has
> grown to the point that it's causing performance problems
> when cloning the project.
>
> Is anyone familiar with git gc deleting valid references?
> I'm running git version 1.7.8. Have there been any
> patches in later git releases that might address this
> issue ( if it is a git problem )?
When Earl was testing ref-packing a few months ago, that the
refs in question where reported invalid by git show-ref:
git show-ref 2>&1 |grep refs/changes/45/129345/1
error: refs/changes/45/129345/1 does not point to a valid
object!
But we could trace the refs manually to git show-object just
fine. But oddly enough, when using git show-ref with the -v,
the error above would not be spit out.
So, my guess is that something during the repack was
following the same code path that git show-ref (without the -
v) was following and determining that the ref was invalid and
therefor it was not able to add it to the new packfile, but
yet perhaps it was still being added to the prune-list and
thus getting pruned? Is this possible somehow?
Looking at handle_one_ref() I can't see how. The fprintf()
happens before the ref is added to the prune list and is
unconditional. I am grasping here, but what if the sha1
passed into handle_one_ref() somehow gets set incorrectly to
000...? Would it then basically get written to the packed-
ref file as 000... (deleted), but then still get added to the
prune list? You might say "but then it wouldn't get pruned
since the loose ref doesn't match 000..., but if the logic
which checks this matching makes the same error reading the
sha1 and thinks it is 000... it might then get pruned?
-Martin
prev parent reply other threads:[~2013-01-02 22:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-22 1:41 Missing Refs after Garbage Collection Earl Gresh
2012-12-22 22:26 ` Dmitry Potapov
2012-12-23 1:04 ` Jeff King
2013-01-02 22:43 ` Martin Fick [this message]
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=201301021543.08029.mfick@codeaurora.org \
--to=mfick@codeaurora.org \
--cc=egresh@codeaurora.org \
--cc=git@vger.kernel.org \
/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).