Hi Emmanuel,

On Mon, Mar 16, 2009 at 7:16 AM, Emmanuel Lecharny <elecharny@apache.org> wrote:
Hi guys,

after having thought about the configuration a bit more, I'm not sure that it should be associated with a replication interceptor. I'm not even sure that such an interceptor makes sense.

If we consider both side, a server can be either a client, a server, or both. But we will consider each case as distinct.

If the server is a client (a replica, or a consumer), then  it connects to a master server using a RefreshAndPersist control associated to a search request. This connection can be managed in a specific interceptor, but in any case, the searchResults will have to go through the whole chain.  As it's also a persistent connection, it would be better to deal with it at the DirectoryService level.

If the server is a master (a producer), then we will consider that a client search request has been received, and persists. All the resulting entries are filtered by the chain, and AFAICT, we don't need to add an interceptor to filter the results. We just have to consider that the clinet is a standard client.

Regarding Repl Terminology

OK let's get religious about using replication specific terminology.  Instead of talking about client, server, master, slave, let's use the terms supplier and consumer.  The reason why I like these terms besides their common use is because it clearly denotes directionality and breaks down elements of the replication agreements to their atomic components. So I'd like to think in terms of a consumer configuration (with replication agreement) and a supplier configuration (also with a repl-agmt).

Regarding Configuration

On a separate note, I've been torn between two ways of thinking about configuration for some time.  Regardless of whether we're talking about replication subsystem or not, we could apply this general discussion to any feature/facet of the server which also contains an interceptor.  So this discussion applies across the board as a configuration issue.

So where do we configure a subsystem? In the interceptor configuration? Or as a separate component under the directory service.  Over the years I've made many mistakes with this stuff.  I like the idea of having a high level subsystem bean that contains all the configuration for the feature in one place instead of being distributed all over the configuration tree.  Localization is always good because then the user and developer only needs to goto one place to get this information or modify the code for it.  It's more manageable.

I was always uncomfortable with bloating these interceptors with code.  Instead I just wanted to leave them as simple hooks that funneled events (calls) into the subsystem.  The intercetor is then a simple listener that belongs to the subsystem in question. So the listener detects events and shuffles them into the subsystem to properly respond.  This allows us to keep the configuration in the top level subsystem facade while properly designing the various parts of the subsystem underneath with clarity instead of jamming all the subsystem handling logic tightly into interceptors which leads to code bloat in the interceptor modules leading to a jumbled up mess that is hard to manage.

So I recommend the following:

  (1) Implement a subsystem for replication with a top level facade bean that can be configured via XBean. 
  (2) Setup a means to setup a set of replication agreements.  The same DSA can be both a consumer and a supplier to many other DSAs.  So we'll have a set of consumer agreements and a set of supplier agreements.
  (3) Build the interceptor out to be just a simple hook into other Classes in the subsystem.  Make the subsystem return values for LDAP methods in the chain that require return values.
  (4) Don't wory about adding the replication intercetor to the chain via XBean, just have the subsystem inject the intercetor programatically.  The user does not need to know this interceptor even exists right?

DirectoryService vs. LdapServer

Now I don't know the answer to this but something itches me about putting the replication subsystem into the DirectoryService.  For some time now the DS corresponding to the top level facade representing what we always refered to as the core.  The core was never supposed to be networked because then that would pull dependencies like MINA.  It was the frontend that had network capability.  I know mitosis broke from this but seems the moron who wrote it broke all the rules.

Question is do we want replication to be a high level system in the frontend since it leverages the protocol? Or do we want it in the DS which was traditionally core services without networking?

As I write this I am leaning towards the LdapServer.  What we have to ask ourselves is does the replication subsystem need access to protocol layer structures and information? Another question is does anything other than the interceptor need access to the ReplicationManager facade (presuming this is what we named it).

This is a very important question.


So I would suggest to move the replication configuration at a higher level (DirectoryService), and remove the ReplicationInterceptor.

This is not definitive, I'm waiting for any comment before moving on this direction regarding to the interceptor removal (I'm not 100% sure that we don't need some replication specific filtering, for instance).

wdyt ?

cordialement, regards,
Emmanuel Lécharny