All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] Order of push/pull file transfers
@ 2005-06-23 10:12 Russell King
  2005-06-24 16:38 ` Daniel Barkalow
  0 siblings, 1 reply; 2+ messages in thread
From: Russell King @ 2005-06-23 10:12 UTC (permalink / raw)
  To: git

Hi,

I'd like to start a discussion on the ordering of the various git files
being transferred.

Last night, I pulled Linus' kernel tree from k.o, but Linus was in the
middle of pushing an update to it.  The way cogito works, it grabs the
HEAD first, and then rsyncs the objects.

However, this retrieved the updated HEAD, and only some of the objects.
cogito happily tried to merge the result, and failed.  A later pull
and git-fsck-cache confirmed everything was fine _in this instance_.

Therefore, may I suggest the following two changes in the way git
works:

1. a push updates HEAD only after the rsync/upload of all objects is
   complete.  This means that any pull will not try to update to the
   new head with a partial object tree.

2. a pull only tries to fetch objects if HEAD has been updated since
   the last pull.

This gives a pull-er an additional safety margin which ensures that
merges will not be attempted when a simultaneous pull and push occurs
at the same time.

-- 
Russell King


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

* Re: [RFC] Order of push/pull file transfers
  2005-06-23 10:12 [RFC] Order of push/pull file transfers Russell King
@ 2005-06-24 16:38 ` Daniel Barkalow
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Barkalow @ 2005-06-24 16:38 UTC (permalink / raw)
  To: Russell King; +Cc: git

On Thu, 23 Jun 2005, Russell King wrote:

> Last night, I pulled Linus' kernel tree from k.o, but Linus was in the
> middle of pushing an update to it.  The way cogito works, it grabs the
> HEAD first, and then rsyncs the objects.

It needs to do this, in case HEAD changes after or during the rsync (to
include objects written after the rsync looked for them).

> However, this retrieved the updated HEAD, and only some of the objects.
> cogito happily tried to merge the result, and failed.  A later pull
> and git-fsck-cache confirmed everything was fine _in this instance_.

It should be fine in all instances; it makes no assuptions about the
presence or absence of objects in the local database before the pull, so
doing a pull after the previous one didn't work right should be just as
likely to result in a functional state as any other pull.

> Therefore, may I suggest the following two changes in the way git
> works:
> 
> 1. a push updates HEAD only after the rsync/upload of all objects is
>    complete.  This means that any pull will not try to update to the
>    new head with a partial object tree.

git-ssh-push only updates the HEAD (or, rather, the thing the HEAD is a
symlink to) afterwards. I'm not sure how Linus was getting things
there. It's also possible that the mirroring process is failing to
maintain this constraint.

> 2. a pull only tries to fetch objects if HEAD has been updated since
>    the last pull.

That's no good; if the only recent change is a new tag, you want to get 
the tag object. Also, having it not do this is what let it recover in your
case on the second try. The only risk is that you'll pick up some objects
that you don't need yet (but would need if you pulled again when the push
completes).

	-Daniel
*This .sig left intentionally blank*


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

end of thread, other threads:[~2005-06-24 16:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-23 10:12 [RFC] Order of push/pull file transfers Russell King
2005-06-24 16:38 ` Daniel Barkalow

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.