[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: replica write-through

Quanah Gibson-Mount wrote:

--On Saturday, September 16, 2006 6:53 PM -0400 matthew sporleder <msporleder@gmail.com> wrote:

I was wondering if clever use of syncrepl could be used to simulate
replica-write-through.  To explain- a client could send a write to a
replica, who would accept the write and send it through to the master
who would know to update the rest of the comsumers (the original
consumer already accepted the write, so it knows that it's in sync).

There are ways to do something close to this, where the replica forwards the write to the master (rather than returning a referral), and then all the replicas get sync'd by the master.

The chaining overlay will allow any slave (slurpd or syncrepl) to forward writes to the master. Matthew is asking for something slightly different, he wants the receiving slave to update its own database immediately, while forwarding the write to the master.

We've talked about this on the lists several times in the past. I wrote the code for it a couple years ago, it was a simple patch. But it turns out to be a bad idea, because (especially with slurpd) you don't really know that the receiving slave is in sync with the master at the time. The write could easily fail on the master, after the slave had already committed it, then you'd just need to do even more work to undo it. (Otherwise the slave is permanently out of sync...)

  -- Howard Chu
  Chief Architect, Symas Corp.  http://www.symas.com
  Director, Highland Sun        http://highlandsun.com/hyc
  OpenLDAP Core Team            http://www.openldap.org/project/