Re: Write, then read & mirror-mode

Jonathan Clarke <[email protected]>
Newsgroups gmane.network.openldap.general
Message-ID <[email protected]>
On 29/09/2009 10:17, Peter Mogensen wrote:
> Hi,
>
> 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.
>
> Like:
> 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
-- 
--------------------------------------------------------------
Jonathan Clarke - [email protected]
--------------------------------------------------------------
Ldap Synchronization Connector (LSC) - http://lsc-project.org
--------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.