Re: [RFC Patch] Preventing corrupt objects from entering the repository

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Nicolas Pitre <nico@...>
Cc: Junio C Hamano <gitster@...>, <git@...>
Date: Tuesday, February 12, 2008 - 5:38 pm

On Tue, Feb 12, 2008 at 03:22:17PM -0500, Nicolas Pitre wrote:

Freeing the data is not my problem.

Many validations are in parse_XXX_buffer, which are also used by
fsck. This returns a struct commit/tree/tag/blob.

I have not found any code in git to free them. 

Same for pack-objects, e.g. add_objects_in_unpacked_packs allocates
many struct object via lookup_unknown_object. As far as I understand
the code, they are never freed, even if they are not needed later.


It only loads all objects, it checks (eg. no objects from the pack file
by default). After loading a object, it frees the content of object,
but keeps the parsed information in memory for the connectivity check.


So you propose the following:
1) run index-pack (write pack file + index in repository)
2) fsck pack file
3) update refs

This looks to be very prone to race conditions, if multiple
pushes run concurrently.

To be on the safe side, the checks must be finished, before a pack/object
becomes part of the repository. We must check the reachability before 
index-pack writes the index.

In my opinion, separating the code for the reachability check from
index-pack would complicate things. It would not safe memory, as the
memory would be used by two processes instead of one.

You don't want to increase the resource usage of index-pack. If
--strict is not passed, I implemented this. 

For --strict, it is not avoidable, that index-pack will use more
memory and cpu time.

mfg Martin Kögler

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [RFC Patch] Preventing corrupt objects from entering the..., Johannes Schindelin, (Wed Feb 13, 8:01 am)
Re: [RFC Patch] Preventing corrupt objects from entering the..., Johannes Schindelin, (Thu Feb 14, 8:06 pm)
Re: [RFC Patch] Preventing corrupt objects from entering the..., Martin Koegler, (Tue Feb 12, 5:38 pm)
[RFC PATCH] Remove object-refs from fsck, Shawn O. Pearce, (Thu Feb 14, 5:00 am)
Re: [RFC PATCH] Remove object-refs from fsck, Martin Koegler, (Thu Feb 14, 3:07 pm)