4 ms·
The interesting bit here will be how they reconcile potentially conflicting changes between the replicas. It is pretty easy to replicate the data, because git
by justinsb 11y ago
The interesting bit here will be how they reconcile potentially conflicting changes between the replicas. It is pretty easy to replicate the data, because git is content-addressable and can go garbage collection - I think even rsync would work. The challenge is that when e.g. the master branch is updated, you essentially have a simple key-value database that you must update deterministically. I look forward to learning how github chose to solve that challenge!
- LukeShu 11y agorsync would only work well if there aren't any pack files (which reduce the disk space used, and access times). Pack files break the simplicity of the basic content-addressed store by compressing multiple objects together.
- justinsb 11y agoRight, but it doesn't really matter if you have objects stored twice (or more) I believe. The next GC will clean it up anyway.
- lotyrin 11y agoThe replica count seems to be three - allowing quorum with a single lost host - and the repository goes read-only when quorum is lost.
- im_down_w_otp 11y agoThat doesn't do anything to resolve consistency issues. The only time that quorum, pinned to primary replicas (i.e. disallowing sloppy failovers), helps you with consistency is when all reads and writes to those replicas are funneled through a serialized reader/writer. Then that serialized process can ensure "Read Your Own Writes" consistency using majority quorum (again, pinned to primary replicas). So they're either doing strongly coordinated writes to make sure replication changes are consistent (serializer, consensus, or chain), they're encoding other causal information in the data and have some method that deterministically picks which replica should dominate the others, or they're silently losing updates on conflicts. It would be cool to know what they're doing.
- prirun 11y agoThe article said "Writes are synchronously streamed to all three replicas and are only committed if at least two replicas confirm success."
- im_down_w_otp 11y agoSomehow missed that. Thank you. So quorum + 2PC is what that sounds like to me. Suffice it to say, that's not a safe protocol without some other system guarantees in place.
- jvoorhis 11y agoI'm not sure how GH solved this, but consistently updating refs in that simple k-v store seems to be the main challenge. I wonder whether the receive-pack operation offers a natural boundary for transactions?