...
field | type | Primary key | description |
---|---|---|---|
CSN_REPLICA_ID | VARCHAR(16) NOT NULL | Yes | The replica ID |
CSN_TIMESTAMP | BIGINT NOT NULL | Yes | The Timestamp |
CSN_OP_SEQ | INTEGER NOT NULL | Yes | The op sequence |
OPERATION | BLOB NOT NULL | no | The replication operation |
Operation storage
Each operation is logged into the REPLICATION_LOG table. It has to be serialized first to be put into the OPERATION field. The CSN is spread in three columns for a better search.
Wiki Markup |
---|
The serialized Operation structure will depend on the operation. In any case, its a triplet <OpType, CSN, \[serialized op\]>, where the \[serialized op\] can be composite. For instance, we may have something like <OpType, CSN, <OpType, CSN, entry> <Optype, CSN, entry>> if we deal with a composite operation. |
The AddEntry operation is serialized as <OpType, CSN, Entry>
The XXXAttribute operations are serialized as <OpType, CSN, <dn, id, attribute>>
The composite operations are serialized as <OpType, CSN, list of serialized children>
Note |
---|
The CSN is already a part of the entry for an Add operation, it's not necessary to serialize it. |
Note |
---|
We use a specific serialization, Java based, to store the operation. It would be way better to store a LDIF, assuming we always consider the CSN as a modified attribute. |
Configuration
The replication system is a Multi-Master replication, ie, each server can update any server it is connected to. The way you tell a server to replicate to others is simple :
...
Each of the interceptor's method handling an entry modification will use one of those classes to store the resulting modification.
Operations
Add operation
It creates a AddEntryOperation object, with a ADD_ENTRY operation type (how useful is it, considering that we are already defined a specific class for such an operation ???), an entry and a CSN.
...
Note |
---|
As we may receive a Add request from a remote server - per replication activation -, we currently create so called glue-entries. There are necessary if we consider that an entry is added when the underlaying tree is absent. This can happen in a MMR scenario where those missing entries have not been received yet, but the leaves have been. |
Delete operation
It creates a CompositeOperation object, which contains a ReplaceAttributeOperation, as the entry is not deleted, but instead a entryDeleted AttributeType is added to the entry, and a ReplaceAttributeOperation containing the injection of a entryCSN AttributeType, with a newly created CSN.
...