mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Fabio Pistolesi
14.45.2016 f095fd89e6e8a45f4aabf62b127f907001319f82
OPENDJ-2792 Enable permissive modifies when replicating schema changes

Applying replicated modifications on schema should not fail if schema definitions are already present.
1 files modified
13 ■■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/LDAPReplicationDomain.java 13 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/LDAPReplicationDomain.java
@@ -19,6 +19,7 @@
import static org.forgerock.opendj.ldap.ResultCode.*;
import static org.opends.messages.ReplicationMessages.*;
import static org.opends.messages.ToolMessages.*;
import static org.opends.server.config.ConfigConstants.DN_DEFAULT_SCHEMA_ROOT;
import static org.opends.server.protocols.internal.InternalClientConnection.*;
import static org.opends.server.protocols.internal.Requests.*;
import static org.opends.server.replication.plugin.EntryHistorical.*;
@@ -369,6 +370,8 @@
    "2.5.4.0" // objectClass OID
  };
  private static final DN SET_PERMISSIVE_MODIFY_FOR_DN = DN.valueOf(DN_DEFAULT_SCHEMA_ROOT);
  /**
   * When true, this flag is used to force the domain status to be put in bad
   * data set just after the connection to the replication server.
@@ -2312,6 +2315,16 @@
          // are processed locally.
          op.addRequestControl(new LDAPControl(OID_MANAGE_DSAIT_CONTROL));
          // Warning: specific processing ahead. See OPENDJ-2792
          if (op instanceof ModifyOperation)
          {
            ModifyOperation modifyOperation = (ModifyOperation) op;
            if (modifyOperation.getEntryDN().equals(SET_PERMISSIVE_MODIFY_FOR_DN))
            {
              op.addRequestControl(new LDAPControl(OID_PERMISSIVE_MODIFY_CONTROL));
            }
          }
          csn = OperationContext.getCSN(op);
          op.run();