[Date Prev][Date Next]
Re: Re: replica write-through
On 9/17/06, Howard Chu <email@example.com> wrote:
Quanah Gibson-Mount wrote:
> --On Saturday, September 16, 2006 6:53 PM -0400 matthew sporleder
> <firstname.lastname@example.org> 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...)
This is, indeed, what I was talking about. However, since openldap
offers near real-time replication (triggered replication), it's not
much of a problem to just chain to the master and wait for the update.