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

Re: Write, then read & mirror-mode

On 29/09/2009 10:17, Peter Mogensen wrote:

I about to set up a mirror-mode server pair with a slapd-ldap proxy to
access them through.
But it strikes me that the small delay for replication may result in
race conditions for applications which use write, then read of entries.

The application creates an object through the proxy, which forwards the
add request to server-1. Immediately after the application tries to read
the object back, but now the proxy have a small chance for redirecting
the search request to server-2 ... before replication has been done?

Is this correct? Is there anyway to avoid it besides writing directly to
server-1 or server-2 and reading back from the same server?

Yes, this is absolutely correct.

Mirror-mode is intended to have a spare-master available, should the main-master go down for any reason. So you should really just point your proxy at server-1, and only use server-2 if server-1 is no longer available (at least for applications that write to the directory).

Using the two simultaneously for writes doesn't bring any performance improvement (the write is still performed on both servers, so takes just as many resources), and if you need to scale reads, set up some replicas.

Hope this helps,
Jonathan Clarke - jonathan@phillipoux.net
Ldap Synchronization Connector (LSC) - http://lsc-project.org