* git repo being corrupted?
@ 2008-04-07 10:04 Luke Diamand
2008-04-07 11:17 ` Luciano Rocha
0 siblings, 1 reply; 6+ messages in thread
From: Luke Diamand @ 2008-04-07 10:04 UTC (permalink / raw)
To: git
I've recently started to notice the following being reported:
% git-status
error: bad index file sha1 signature
fatal: index file corrupt
(a) Is there anything I can do to fix this (apart from git-clone from
the repo and start over) ? git-fsck reports the same problem.
(b) What is causing it? Is it just my hard disk failing, or is it a bug?
A memory test seems to be OK.
Linux 2.6.22-3-amd64
File system is XFS
git version 1.5.4.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git repo being corrupted?
2008-04-07 10:04 git repo being corrupted? Luke Diamand
@ 2008-04-07 11:17 ` Luciano Rocha
2008-04-07 11:21 ` Luke Diamand
0 siblings, 1 reply; 6+ messages in thread
From: Luciano Rocha @ 2008-04-07 11:17 UTC (permalink / raw)
To: Luke Diamand; +Cc: git
[-- Attachment #1: Type: text/plain, Size: 661 bytes --]
On Mon, Apr 07, 2008 at 11:04:17AM +0100, Luke Diamand wrote:
> I've recently started to notice the following being reported:
>
> % git-status
> error: bad index file sha1 signature
> fatal: index file corrupt
>
> (a) Is there anything I can do to fix this (apart from git-clone from
> the repo and start over) ? git-fsck reports the same problem.
rm -f .git/index should do it.
> (b) What is causing it? Is it just my hard disk failing, or is it a bug?
> A memory test seems to be OK.
>
> Linux 2.6.22-3-amd64
> File system is XFS
> git version 1.5.4.4
You're using XFS. Did you have a power fail in the recent past?
--
lfr
0/0
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git repo being corrupted?
2008-04-07 11:17 ` Luciano Rocha
@ 2008-04-07 11:21 ` Luke Diamand
2008-04-07 11:39 ` Luciano Rocha
0 siblings, 1 reply; 6+ messages in thread
From: Luke Diamand @ 2008-04-07 11:21 UTC (permalink / raw)
To: Luciano Rocha; +Cc: git
Luciano Rocha wrote:
>> Linux 2.6.22-3-amd64
>> File system is XFS
>> git version 1.5.4.4
>
> You're using XFS. Did you have a power fail in the recent past?
How did you know?
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git repo being corrupted?
2008-04-07 11:21 ` Luke Diamand
@ 2008-04-07 11:39 ` Luciano Rocha
2008-04-07 16:15 ` David Brown
0 siblings, 1 reply; 6+ messages in thread
From: Luciano Rocha @ 2008-04-07 11:39 UTC (permalink / raw)
To: Luke Diamand; +Cc: git
[-- Attachment #1: Type: text/plain, Size: 795 bytes --]
On Mon, Apr 07, 2008 at 12:21:40PM +0100, Luke Diamand wrote:
> Luciano Rocha wrote:
>
> >> Linux 2.6.22-3-amd64
> >> File system is XFS
> >> git version 1.5.4.4
> >
> > You're using XFS. Did you have a power fail in the recent past?
>
> How did you know?
XFS doesn't order metadata writes with data writes, so if the power
fails, it can find an update in the journal but the data wasn't written.
Then it fills the file with zeroes to the new size.
I've lost /etc/passwd once with that behaviour...
Also, ext3 doesn't order the metadata and data updates with
data=writeback, but the default is data=ordered, which does.
I use xfs, but only when I know I have at least daily backups (or on
systems with UPS and with UPS initiated orderly shutdowns).
--
lfr
0/0
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git repo being corrupted?
2008-04-07 11:39 ` Luciano Rocha
@ 2008-04-07 16:15 ` David Brown
2008-04-07 16:47 ` Luciano Rocha
0 siblings, 1 reply; 6+ messages in thread
From: David Brown @ 2008-04-07 16:15 UTC (permalink / raw)
To: Luciano Rocha; +Cc: Luke Diamand, git
On Mon, Apr 07, 2008 at 12:39:21PM +0100, Luciano Rocha wrote:
>> > You're using XFS. Did you have a power fail in the recent past?
>>
>> How did you know?
>
>XFS doesn't order metadata writes with data writes, so if the power
>fails, it can find an update in the journal but the data wasn't written.
>Then it fills the file with zeroes to the new size.
This behavior should be a lot better for recent kernels.
xfs does even better with write barriers. But any file change that is more
than one write can be corrupted or split by an inopportune powerdown.
David
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git repo being corrupted?
2008-04-07 16:15 ` David Brown
@ 2008-04-07 16:47 ` Luciano Rocha
0 siblings, 0 replies; 6+ messages in thread
From: Luciano Rocha @ 2008-04-07 16:47 UTC (permalink / raw)
To: Luke Diamand, git
[-- Attachment #1: Type: text/plain, Size: 866 bytes --]
On Mon, Apr 07, 2008 at 09:15:25AM -0700, David Brown wrote:
> On Mon, Apr 07, 2008 at 12:39:21PM +0100, Luciano Rocha wrote:
>
> >> > You're using XFS. Did you have a power fail in the recent past?
> >> How did you know?
> >
> > XFS doesn't order metadata writes with data writes, so if the power
> > fails, it can find an update in the journal but the data wasn't written.
> > Then it fills the file with zeroes to the new size.
>
> This behavior should be a lot better for recent kernels.
To be fair, it hasn't happened to me lately. But I haven't lost power
often, so I can't say it's fixed. ;)
> xfs does even better with write barriers. But any file change that is more
> than one write can be corrupted or split by an inopportune powerdown.
Maybe, but I'm still waiting for barrier support through device-mapper.
--
lfr
0/0
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-04-07 16:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-07 10:04 git repo being corrupted? Luke Diamand
2008-04-07 11:17 ` Luciano Rocha
2008-04-07 11:21 ` Luke Diamand
2008-04-07 11:39 ` Luciano Rocha
2008-04-07 16:15 ` David Brown
2008-04-07 16:47 ` Luciano Rocha
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).