Thread (8 messages) 8 messages, 4 authors, 2016-06-15

broken repo after power cut

From: Richard Weinberger <richard@nod.at>
Date: 2016-06-15 23:05:25

Hi!

Yesterday our git server faced a power cut and a git repository broke.
The server is running a ext4 filesystem on top of Linux 3.16 (stable from openSUSE) and git 2.1.4.
We had a backup, so no data was lost but I really would like to figure out
what happened.

This is the output of git fsck:
Checking object directories: 100% (256/256), done.
error: object file objects/ce/f7627fc160ad7294b1f728db0c1ddb65a38b1d is empty
error: object file objects/ce/f7627fc160ad7294b1f728db0c1ddb65a38b1d is empty
fatal: loose object cef7627fc160ad7294b1f728db0c1ddb65a38b1d (stored in objects/ce/f7627fc160ad7294b1f728db0c1ddb65a38b1d) is corrupt

To me it seems like git was creating a new object and got interrupted before fsync/fdatasync'ing it.
As the object was referenced before syncing the data to disk the repo broke.
Could this have happened?
Also, is git designed to survive power cuts? Then referencing an object before synching it do disk would make no sense.

Thanks,
//richard
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help