skip to content
~11 min

Errors now, or conflicts later

To keep consistency, one side has to refuse, and KataTube's rule names it: while the link is down, only the EU creates channels. Bob is told “try later”. When the link returns there is nothing to repair, and on his next try he is told @nova is taken.

The link is down and Bob asks for @nova. Refusing costs him an error now. Answering costs KataTube a later.
AliceBerlinowns @novaKataTube · EU@nova→AliceAlicelink backKataTube · US@nova→refusesit refusedsuppose it answerssuppose it answeredfreeAlicecopiedBobBobBobBostoncreate @nova“try later”: an error now“ok, it's yours”: a conflict latercreate @novaerror: try latercreate @nova, again@nova is takennothing to repaircreate @novaok, it's yoursalso owns @novaone must be renamed

Suppose the US side answers instead. Bob is told “ok, it's yours”. Each side now acts as the only owner of the data: a . When the link returns, the two copies meet, and @nova has two owners. That is a : two confirmed changes that cannot both stand.

keep consistencykeep availability
during the cutOne side refuses: errors.Every side answers: some answers are stale.
when the link returnsNothing to repair.Conflicts to repair.
@novaone ownertwo owners

Consistency costs errors now. With three or more copies, the side that refuses is usually the smaller one, which cannot reach most of the copies; its clients wait or get errors.

Which bill is worse depends on the data. Two owners of one handle cannot be undone quietly: refuse. A view counted on both sides harms nothing: the counts add up. Outside KataTube, a lock lets only one server at a time do a job, and a split-brain would give it two holders: refuse. A shopping cart changed on both sides can be merged, and turning a buyer away risks the sale: answer.

in one line

Consistency costs errors now, on the side that refuses; availability costs stale answers now and conflicts later; which bill is worse depends on the data.