git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Problem with pack
@ 2006-08-26 18:49 Sergio Callegari
  0 siblings, 0 replies; 17+ messages in thread
From: Sergio Callegari @ 2006-08-26 18:49 UTC (permalink / raw)
  To: git

>
> Junio C Hamano <junkio@cox.net> writes:
>
> > Earlier you said "unpack-objects <$that-pack.pack" fails with
> > "error code -3 in inflate..."  What exact error do you get?
> > I am guessing that it is get_data() which says:
> >
> > 	"inflate returned %d\n"
> >
> > (side note: we should not say \n there).
> > ...
> > This pattern appears practically everywhere...
> > ...  I've been
> > wondering if it is possible for inflate to eat some input but
> > that was not enough to produce one byte of output, and what [it]
> > would return in such a case...
>
> I do not think this fear does not apply to this particular case;
> return value -3 is Z_DATA_ERROR, so the deflated stream is
> corrupt.
>
> > So there are only a few ways you can get that error message.
> > ...
>
> I just realized there is another not so inplausible explanation.
>
> When the problematic pack was made on the mothership,
> csum-file.c::sha1write_compressed() gave the data for the base
> object to zlib, an alpha particle hit a memory cell that
> contained zlib output buffer (resulting in a corrupt deflated
> stream in variable "out"), and sha1write() wrote it out while
> computing the right checksum.
>
> Is the memory on your mothership reliable (I do not want to make
> this message sound like one on the kernel list, but memtest86
> might be in order)?
>   
For sure you can never say, but so far I have never had any problem with 
that machine nor I had any after this incident...

Sergio
>
>
>
>   

^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re: Problem with pack
@ 2006-08-27 17:45 Sergio Callegari
  2006-08-27 18:27 ` Linus Torvalds
  0 siblings, 1 reply; 17+ messages in thread
From: Sergio Callegari @ 2006-08-27 17:45 UTC (permalink / raw)
  To: git

>
> I do think that your synchronization using unison is _somehow_ part of the 
> reason why bad things happened, but I really can't see why it would cause 
> problems, and perhaps more importantly, git should have noticed them 
> earlier (and, in particular, failed the repack). So a git bug and/or 
> misfeature is involved somehow.
>   
Glad if my broken pack can help finding out!
> One thing that may have happened is that the use of unison somehow 
> corrupted an older pack (or you had a disk corruption), and that it was 
> missed because the corruption was in a delta of the old pack that was 
> silently re-used for the new one.
>
> That would explain how the SHA1 of the pack-file matches - the repack 
> would have re-computed the SHA1 properly, but since the source delta 
> itself was corrupt, the resulting new pack is corrupt.
>   
There is something that I still do not understand... (sorry if I ask 
stupid questions)...
Since packs have an sha signature too, if there was a data corruption 
(disk or transfer), shouldn't that have been detected at the repack? 
I.e. doesn't repack -d verify the available data before cancelling anything?
> If you had used git itself to synchronize the two repositories, that 
> corruption of one repo would have been noticed when it transfers the data 
> over to the other side, which is one reason why the native git syncing 
> tools are so superior to doing a filesystem-level synchronization.
>   
I think I learnt the lesson!
> With a filesystem-level sync (unison or anything else - rsync, cp -r, 
> etc), a problem introduced in one repository will be copied to another one 
> without any sanity checking.
>   
Idem!
> but in the meantime, when you find a place to put the corrupt pack/index 
> file, please include me and Junio at a minimum into the group of people 
> who you tell where to find it (and/or passwords to access it). I'll 
> happily keep your data private (I've done it before for others).
>
>   
Sure... I have already sent an email to Junio to arrange this.

Thanks,
Sergio

^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re: Problem with pack
@ 2006-08-26 18:53 Sergio Callegari
  2006-08-26 19:24 ` Linus Torvalds
  0 siblings, 1 reply; 17+ messages in thread
From: Sergio Callegari @ 2006-08-26 18:53 UTC (permalink / raw)
  To: git

> Earlier you said that the mothership has 1.4.2, and the note has
> 1.4.0.  The sequence of events as I understand are:
>
> 	- repack -a -d on the mothership with 1.4.2; no problems
>           observed.
>
>         - transfer the results to note; this was done behind git so
>           no problems observed.
>
>         - tried to repack on note with 1.4.0; got "failed to
>           read delta-pack base object" error.
>   
Yes... only before that I had a few more iterations PC<->notebook always
syncing with unison.
> Can you make the pack/idx available to the public for
> postmortem?
>   
Yes... I can make them available... the pack/idx actually do not contain
anything extremely confidential (just a bunch of LaTeX files).
Only, being that there is conference data and stuff by people who
professionally organize conferences, I'd prefer to make it available
directly to some specific people that I can trust not re-distributing it
rather than putting it in the general public.
> Also I wonder if the pack can be read by 1.4.2.
>   
No it cannot.
> Earlier you said "unpack-objects <$that-pack.pack" fails with
> "error code -3 in inflate..."  What exact error do you get?
> I am guessing that it is get_data() which says:
>
> 	"inflate returned %d\n"
>   
This is right...
>   
Just a question...
Might the problem have come out of a scenario like the following...

1) I use unison to sync my documents (rather than using the git tools...
silly me!)
2) I get things wrong in controlling unison (without realizing that I
do) and the result is that I lose some blobs.
3) I repack an unclean tree (missing some objects)

Can this be the case?

Thanks

Sergio

^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re: Problem with pack
@ 2006-08-25 12:31 Sergio Callegari
  2006-08-26 18:20 ` Linus Torvalds
  0 siblings, 1 reply; 17+ messages in thread
From: Sergio Callegari @ 2006-08-25 12:31 UTC (permalink / raw)
  To: git

>
> Andreas Ericsson <ae@op5.se> writes:
>
> >> Btw, even without that, if I understand correctly, git packs are
> >> collections of compressed objects, each of which has its own header
> >> stating how long is the compressed object itself. In my case, the
> >> error is in inflating one object (git unpack-objects says inflate
> >> returns -3)... so shouldn't there be a way to try to skip to the
> >> next object even in this case?
> >
> > It should be possible, assuming the pack index is still intact. The
> > pack index is where the headers are stored, afaik.
>
> The problem Sergio seems to be having is because somehow he does
> not have a base object that another object that is in the pack
> depends on, because the latter object is stored in deltified
> form.
>
> This should never happen unless .pack itself is corrupted
> (git-pack-objects, unless explicitly told to do so with --thin
> flag to git-rev-list upstream, would not make a delta against
> objects not in the same pack).
>
> When a delta is written to the pack file, unless its base object
> has already written out, git-pack-objects writes out the base
> object immediately after that deltified object.  So one
> possibility is that the pack was truncated soon after the delta
> that is having trouble with finding its base object.  In such a
> case, the proposed recovery measure of skipping the corruption
> and keep going would not buy you that much.  On the other hand,
> if the corruption is in the middle (e.g. a single disk block was
> wiped out), having .idx file might help you resync.
>
> Does the pack pass git-verify-pack test, I wonder?
If I try to verify the pack I get:

git verify-pack -v pack-ebcdfbbda07e5a3e4136aa1f499990b35685bab4.idx
fatal: failed to read delta-pack base object 
2849bd2bd8a76bbca37df2a4c8e8b990811d01a7


the package length seems reasonable, however... (no evident sign of 
truncation, but I haven't looked inside the index to check the exact 
positions of objects)...
and git unpack-object dies with error code -3 in inflate...
If I am not wrong (but I might easily be so) this should not be relative 
to truncation...

Sergio

^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re: Problem with pack
@ 2006-08-25 10:07 Sergio Callegari
  2006-08-25 10:20 ` Andreas Ericsson
  2006-08-26 10:09 ` Junio C Hamano
  0 siblings, 2 replies; 17+ messages in thread
From: Sergio Callegari @ 2006-08-25 10:07 UTC (permalink / raw)
  To: git

>
> > git verify-pack -v pack-ebcdfbbda07e5a3e4136aa1f499990b35685bab4.idx
> > fatal: failed to read delta-pack base object 2849bd2bd8a76bbca37df2a4c8e8b990811d01a7
>
> Eeeh! Not good.
>
> > 1) I am working on both a pc and a notebook, syncing the two everytime I move
> > from one to the other.
>
> So, you still have one "good" version? Please make a backup immediately. 
> (If only to reproduce the problem.)
>   
I have a good working tree, but unfortunately I realized that there was 
a problem with the pack only _after_ the sync:
I was not expecting this kind of problem, so I silly did a repack as the 
last thing, I went home, I attached the laptop to the net, I run unison, 
I started to work and I realized that there was a problem when I 
attempted a new repack which failed complaining about the corrupted pack...

So actually, I do not even know where the corruption came from (an hd 
error, the sync tool, ...)

I only have the corrupted pack and its index and a good last working tree.

BTW, it would be nice to have some "security measure" in git reset... 
e.g. an option to trigger the following behavior:

- saving all current changes in a temporary commit
- checking that the current HEAD can be re-checked out before the reset

> Since unpack-objects does not use the index, it cannot extract anything 
> after the first error. We _could_ enhance unpack-objects to be nice and 
> optionally take a pack-index to try to reconstruct as many objects as 
> possible.
>   
That would be very useful...
Btw, even without that, if I understand correctly, git packs are 
collections of compressed objects, each of which has its own header 
stating how long is the compressed object itself. In my case, the error 
is in inflating one object (git unpack-objects says inflate returns 
-3)... so shouldn't there be a way to try to skip to the next object 
even in this case?
> BTW I'd recommend not syncing with unison, but with the git transports: If 
> your PC and Laptop are connected, you could do something like
>
> 	git pull laptop:my_project/.git
>   
Actually, the project, including the git archive gets syncronized as a 
part of a syncronization process including all my Documents directory 
(the project is in fact a LaTeX manual with somehow complex LaTeX 
packages and classes). Syncronizing in this way actually worked very 
well so far, because at once I was getting in sync all my working trees 
and all my repos...

Sergio

^ permalink raw reply	[flat|nested] 17+ messages in thread
* Problem with pack
@ 2006-08-25  8:45 Sergio Callegari
  2006-08-25  9:12 ` Johannes Schindelin
  0 siblings, 1 reply; 17+ messages in thread
From: Sergio Callegari @ 2006-08-25  8:45 UTC (permalink / raw)
  To: git

Hi,

I am encountering a problem after a

git repack -a -d

on an archive.

The packet that has been generated appears to be corrupted:

git verify-pack -v pack-ebcdfbbda07e5a3e4136aa1f499990b35685bab4.idx
fatal: failed to read delta-pack base object 
2849bd2bd8a76bbca37df2a4c8e8b990811d01a7

and apparently I might have lost all the history of my project.

I have a few questions:

1) I am working on both a pc and a notebook, syncing the two everytime I 
move from one to the other.
On the PC I have git 1.4.2, on the notebook git 1.4.0. I am using 
"unison" as a syncing tool.
Might the data loss have something to do with...
- the version of git I am using or the mixing of two versions?
- the syncing? I have noticed that after a sync, git is not immediately 
in a happy state... for instance if I run

git diff

git lists diff commands for every file, even if those have not changed. 
However after a

git status

everything seems fine again.

2) git unpack-objects seems to be able to extract some objects from the 
pack, but at a certain point it dies.
- does it die on the first error or does it try to extract everything 
that is possible to extract after the error?
- if it's the first, is there a way to trigger the second behaviour to 
try to save as much as possible from the pack?

Thanks,

Sergio Callegari

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2006-08-27 21:55 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-26 18:49 Problem with pack Sergio Callegari
  -- strict thread matches above, loose matches on Subject: below --
2006-08-27 17:45 Sergio Callegari
2006-08-27 18:27 ` Linus Torvalds
2006-08-27 19:26   ` Nicolas Pitre
2006-08-27 21:55   ` Junio C Hamano
2006-08-26 18:53 Sergio Callegari
2006-08-26 19:24 ` Linus Torvalds
2006-08-25 12:31 Sergio Callegari
2006-08-26 18:20 ` Linus Torvalds
2006-08-25 10:07 Sergio Callegari
2006-08-25 10:20 ` Andreas Ericsson
2006-08-25 10:41   ` Jakub Narebski
2006-08-25 10:58   ` Junio C Hamano
2006-08-26 10:09 ` Junio C Hamano
2006-08-26 10:31   ` Junio C Hamano
2006-08-25  8:45 Sergio Callegari
2006-08-25  9:12 ` Johannes Schindelin

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).