{"thread":{"id":"13011","subject":"git repo being corrupted?","startedAt":"2008-04-07T10:04:17Z","lastAt":"2008-04-07T16:47:38Z","messageCount":6,"participants":["Luke Diamand","Luciano Rocha","David Brown"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"73816","messageId":"47F9F1A1.30009@diamand.org","threadId":"13011","inReplyTo":null,"subject":"git repo being corrupted?","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2008-04-07T10:04:17Z","receivedAt":"2008-04-07T10:04:17Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"I've recently started to notice the following being reported:\n\n% git-status\nerror: bad index file sha1 signature\nfatal: index file corrupt\n\n(a) Is there anything I can do to fix this (apart from git-clone from\nthe repo and start over) ? git-fsck reports the same problem.\n\n(b) What is causing it? Is it just my hard disk failing, or is it a bug?\nA memory test seems to be OK.\n\nLinux 2.6.22-3-amd64\nFile system is XFS\ngit version 1.5.4.4\n"},{"id":"73818","messageId":"20080407111740.GA12776@bit.office.eurotux.com","threadId":"13011","inReplyTo":"47F9F1A1.30009@diamand.org","subject":"Re: git repo being corrupted?","fromName":"Luciano Rocha","fromEmail":"luciano@lsd.di.uminho.pt","sentAt":"2008-04-07T11:17:40Z","receivedAt":"2008-04-07T11:17:40Z","isPatch":false,"sender":{"key":"luciano@lsd.di.uminho.pt","avatar":null},"body":"On Mon, Apr 07, 2008 at 11:04:17AM +0100, Luke Diamand wrote:\n> I've recently started to notice the following being reported:\n> \n> % git-status\n> error: bad index file sha1 signature\n> fatal: index file corrupt\n> \n> (a) Is there anything I can do to fix this (apart from git-clone from\n> the repo and start over) ? git-fsck reports the same problem.\n\nrm -f .git/index should do it.\n\n> (b) What is causing it? Is it just my hard disk failing, or is it a bug?\n> A memory test seems to be OK.\n> \n> Linux 2.6.22-3-amd64\n> File system is XFS\n> git version 1.5.4.4\n\nYou're using XFS. Did you have a power fail in the recent past?\n\n-- \nlfr\n0/0\n"},{"id":"73817","messageId":"47FA03C4.9030104@diamand.org","threadId":"13011","inReplyTo":"20080407111740.GA12776@bit.office.eurotux.com","subject":"Re: git repo being corrupted?","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2008-04-07T11:21:40Z","receivedAt":"2008-04-07T11:21:40Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"Luciano Rocha wrote:\n\n>> Linux 2.6.22-3-amd64\n>> File system is XFS\n>> git version 1.5.4.4\n> \n> You're using XFS. Did you have a power fail in the recent past?\n\nHow did you know?\n\n> \n"},{"id":"73819","messageId":"20080407113921.GA13667@bit.office.eurotux.com","threadId":"13011","inReplyTo":"47FA03C4.9030104@diamand.org","subject":"Re: git repo being corrupted?","fromName":"Luciano Rocha","fromEmail":"luciano@lsd.di.uminho.pt","sentAt":"2008-04-07T11:39:21Z","receivedAt":"2008-04-07T11:39:21Z","isPatch":false,"sender":{"key":"luciano@lsd.di.uminho.pt","avatar":null},"body":"On Mon, Apr 07, 2008 at 12:21:40PM +0100, Luke Diamand wrote:\n> Luciano Rocha wrote:\n> \n> >> Linux 2.6.22-3-amd64\n> >> File system is XFS\n> >> git version 1.5.4.4\n> > \n> > You're using XFS. Did you have a power fail in the recent past?\n> \n> How did you know?\n\nXFS doesn't order metadata writes with data writes, so if the power\nfails, it can find an update in the journal but the data wasn't written.\nThen it fills the file with zeroes to the new size.\n\nI've lost /etc/passwd once with that behaviour...\n\nAlso, ext3 doesn't order the metadata and data updates with\ndata=writeback, but the default is data=ordered, which does.\n\nI use xfs, but only when I know I have at least daily backups (or on\nsystems with UPS and with UPS initiated orderly shutdowns).\n\n-- \nlfr\n0/0\n"},{"id":"73827","messageId":"20080407161525.GA25894@old.davidb.org","threadId":"13011","inReplyTo":"20080407113921.GA13667@bit.office.eurotux.com","subject":"Re: git repo being corrupted?","fromName":"David Brown","fromEmail":"git@davidb.org","sentAt":"2008-04-07T16:15:25Z","receivedAt":"2008-04-07T16:15:25Z","isPatch":false,"sender":{"key":"git@davidb.org","avatar":"https://gravatar.com/avatar/94c86a2938470a74c2eac5e2b69afc0871f79a660295c02219597aba8cb101c1?d=mp&s=160"},"body":"On Mon, Apr 07, 2008 at 12:39:21PM +0100, Luciano Rocha wrote:\n\n>> > You're using XFS. Did you have a power fail in the recent past?\n>> \n>> How did you know?\n>\n>XFS doesn't order metadata writes with data writes, so if the power\n>fails, it can find an update in the journal but the data wasn't written.\n>Then it fills the file with zeroes to the new size.\n\nThis behavior should be a lot better for recent kernels.\n\nxfs does even better with write barriers.  But any file change that is more\nthan one write can be corrupted or split by an inopportune powerdown.\n\nDavid\n"},{"id":"73828","messageId":"20080407164738.GA4053@bit.office.eurotux.com","threadId":"13011","inReplyTo":"20080407161525.GA25894@old.davidb.org","subject":"Re: git repo being corrupted?","fromName":"Luciano Rocha","fromEmail":"luciano@lsd.di.uminho.pt","sentAt":"2008-04-07T16:47:38Z","receivedAt":"2008-04-07T16:47:38Z","isPatch":false,"sender":{"key":"luciano@lsd.di.uminho.pt","avatar":null},"body":"On Mon, Apr 07, 2008 at 09:15:25AM -0700, David Brown wrote:\n>  On Mon, Apr 07, 2008 at 12:39:21PM +0100, Luciano Rocha wrote:\n> \n> >> > You're using XFS. Did you have a power fail in the recent past?\n> >> How did you know?\n> >\n> > XFS doesn't order metadata writes with data writes, so if the power\n> > fails, it can find an update in the journal but the data wasn't written.\n> > Then it fills the file with zeroes to the new size.\n> \n>  This behavior should be a lot better for recent kernels.\n\nTo be fair, it hasn't happened to me lately. But I haven't lost power\noften, so I can't say it's fixed. ;)\n\n>  xfs does even better with write barriers.  But any file change that is more\n>  than one write can be corrupted or split by an inopportune powerdown.\n\nMaybe, but I'm still waiting for barrier support through device-mapper.\n\n-- \nlfr\n0/0\n"}]}