Subject: Re: Synchronous replication on push

From: "brian m. carlson" <[email-masked]>
Date: Mon, 4 Nov 2024 22:36:20 +0000

On 2024-11-04 at 13:35:44, Taylor R Campbell wrote:
> Thanks, can you expand on how this would work with the constraints I
> listed in my question?  Recapitulating:
> 
>    One option, of course, is to use a replicated file system like
>    glusterfs, or replicated block store like DRBD.  But that
> 
>    (a) likely requires a lot more round-trips than git push/send-pack,
>    (b) can't be used for replication to other git hosts like Github, and
>    (c) can't be used for other remote transports like git-cinnabar.
> 
> It sounds like rsyncing over ssh is incompatible with (b) and (c), but
> perhaps I misunderstood what you're getting at.  I tried to see if
> there is some way that reference-transaction hooks help me here but
> there wasn't anything obvious to me.

It should be noted that you cannot do what GitHub does with the
three-phase commit with arbitrary remotes.  A three-phase commit
provides a prepared-to-commit stage where the backends agree that they
(or at least a majority of them) will make the change.  The Git protocol
doesn't offer such functionality, so you can't use arbitrary remotes for
this purpose.  You'll need to either replicate to only hosts you control
(as GitHub does), or you'll need to give up on having your three-phase
commit operation.
-- 
brian m. carlson (they/them or he/him)
Toronto, Ontario, CA