From: Taylor Blau <me@ttaylorr.com>
To: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Cc: git@vger.kernel.org
Subject: Re: Repository corruption if objects pushed in the middle of repack
Date: Mon, 13 Jun 2022 17:24:27 -0400 [thread overview]
Message-ID: <YqerC883GiwHiiZU@nand.local> (raw)
In-Reply-To: <YqepoUMb3rkKgWqB@nand.local>
On Mon, Jun 13, 2022 at 05:18:25PM -0400, Taylor Blau wrote:
> Hi Konstantin,
>
> On Mon, Jun 13, 2022 at 04:31:45PM -0400, Konstantin Ryabitsev wrote:
> > As far as I know, the maintenance steps we are running shouldn't result in any
> > missing objects, so I'm curious if it's something we're doing wrong (using
> > unsafe flags) or if git isn't properly accounting for some objects that come
> > in during the repack stage. We're seeing this happen fairly routinely, so it's
> > not just a random fluke.
>
> [...]
>
> So I doubt that repack is doing something weird here, though it would be
> extremely interseting if you were able to pause the `repack` process at
> a specific point, push new objects into the repository, and reliably
> demonstrate the corruption.
A much more likely explanation for what is going on has to do with the
`--unpack-unreachable` option you're using.
In your example, any unreachable object written within the last day is
written loose, and anything else older than that is simply discarded. If
the following happens, in order:
- an unreachable object is detected, and marked for deletion
- that object then becomes reachable via some ref-update
- then the object becomes an ancestor of some push which depends on it
- _then_ the object is deleted by repack
...then the repository will be missing some objects which are in its
reachable set, and thus corrupt. IOW, the `--unpack-unreachable` option
(and its successor, cruft packs) are both racy with respect to
ref-updates.
Are you able to find evidence of that race in your logging? I would bet
that is likely what is going on here.
Thanks,
Taylor
next prev parent reply other threads:[~2022-06-13 21:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-13 20:31 Repository corruption if objects pushed in the middle of repack Konstantin Ryabitsev
2022-06-13 21:18 ` Taylor Blau
2022-06-13 21:24 ` Taylor Blau [this message]
2022-06-13 21:32 ` Konstantin Ryabitsev
2022-06-13 21:36 ` Taylor Blau
2022-06-13 21:45 ` Konstantin Ryabitsev
2022-06-13 22:26 ` Chris Torek
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=YqerC883GiwHiiZU@nand.local \
--to=me@ttaylorr.com \
--cc=git@vger.kernel.org \
--cc=konstantin@linuxfoundation.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