Open sourced the hgsql extension

Durham Goode durham at fb.com
Tue Aug 5 15:04:51 CDT 2014


On 8/5/14, 7:48 PM, "Gregory Szorc" <gregory.szorc at gmail.com> wrote:

>On 8/5/14 11:22 AM, Durham Goode wrote:
>> We just flipped the bit and made our hgsql Mercurial extension open
>> source.  You can find it here: 
>>https://urldefense.proofpoint.com/v1/url?u=https://bitbucket.org/facebook
>>/hgsql&k=ZVNjlDMF0FElm4dQtryO4A%3D%3D%0A&r=pHOG6Hz51SkYmYr%2FxoTFzw%3D%3D
>>%0A&m=1MqjTTlHh1wIImkCxAvubA8GJBZGLsA1IqwpkuHuGNY%3D%0A&s=9d38c7b1c000acb
>>af5bf9a8d7fccc259aa6ae78497b09136dd9230e18d31df2b
>>
>> The extension allows multiple Mercurial servers to provide read and
>> write access to a single repository at the same time (multi-mastering).
>>   It does this by using a MySQL database to coordinate locking and to
>> immediately synchronize changes between servers.
>>
>> We’ve had this deployed at Facebook for several months now.  It has
>> helped increase our load capacity and has made it almost trivial to
>> handle hardware failures, backups, etc.  There’s still a few rough
>> edges, but so far it’s been pretty stable.
>>
>> If you give it a try, feel free to ping me in IRC (durham on freenode)
>> if you need help setting it up.
>
>Awesome! I anticipate Mozilla looking into this.
>
>Do you plan on upstreaming patches to core to make the hacks less 
>grotesque? I'm looking at things like the copy/paste of revlog.addgroup 
>and the extra localrepo.transaction functionality. The latter we could 
>use at Mozilla for our pushlog data. Although, if we adopt this 
>extension, we'll likely shove pushlog into MySQL (somehow).

We don’t have plans for it at the moment.  For the revlog.addgroup bits, 
the requirement to write things in linkrev order is pretty unusual and I 
can’t think of another use case outside of ours.  Perhaps when we get 
around to allowing multiple linkrevs per rev we can fix this up.  We could 
probably get rid of this hack by moving to bundle2 and generaldelta (which 
hopefully will happen later this year).

As for adding a ‘repo’ object to ‘transaction’, it’d be nice, but the hack 
is low enough risk and the required upstream changes large enough that I 
probably won’t get to it.


More information about the Mercurial-devel mailing list