Question: Multiple users doing push at the same time

Matt Mackall mpm at selenic.com
Mon Dec 11 16:17:35 CST 2006


On Mon, Dec 11, 2006 at 01:33:38PM -0800, Kelly O'Hair wrote:
> Question: How does Mercurial handle multiple users doing an 'hg push' at
> the same time to the same repository?

Writers hold a lock. Pending writers wait until they acquire a lock.
Though in most usage schemes, they'll immediately abort because they
now have to do a merge.

> I guess this question may also apply to anyone doing an 'hg pull' in the
> middle of another user doing an 'hg push'.

The read side is lockless. Ordering of writes on the write side
ensures that readers don't see partial changes.
 
> Teamware used a file Codemgr_wsdata/locks to track who had a lock on
> the workspace during any change to the workspace, and would prevent
> the appropriate activities that could cause the workspace to become
> corrupted. Reporting back that user soandso had a lock on the workspace
> since suchandsuch time.

We currently don't give any feedback about who's holding the write
lock.

Despite the apparent symmetry, pull fundamentally scales better than push.

-- 
Mathematics is the supreme nostalgia of our time.


More information about the Mercurial mailing list