Final fix for OPENDJ-249: dsreplication disable --disableAll error removing contents of "cn=admin data"
Don't remove instance keys when disabling replication. Instance keys are intended for other purposes as well as replication, for example log signing, etc, and may be required after an instance has been removed from a topology. It is the responsibility of administrators to manually remove unused instance keys on a case by case basis.
| | |
| | | LdapName dn = makeDNFromServerProperties(serverProperties); |
| | | try |
| | | { |
| | | if (serverProperties.containsKey( |
| | | ServerProperty.INSTANCE_PUBLIC_KEY_CERTIFICATE)) |
| | | { |
| | | unregisterInstanceKeyCertificate(serverProperties, dn); |
| | | } |
| | | |
| | | // Unregister the server from the server groups. |
| | | String member = "cn=" |
| | | + Rdn.escapeValue(serverProperties.get(ServerProperty.ID)); |
| | |
| | | { |
| | | String[] dns = {getServerContainerDN(), |
| | | getServerGroupContainerDN(), |
| | | getInstanceKeysContainerDN(), |
| | | removeAdministrators ? getAdministratorContainerDN() : null }; |
| | | try |
| | | { |
| | |
| | | @param serverEntryDn The server's ADS entry DN. |
| | | @throws NamingException In case some JNDI operation fails. |
| | | */ |
| | | @SuppressWarnings("unused") |
| | | private void unregisterInstanceKeyCertificate( |
| | | Map<ServerProperty, Object> serverProperties, |
| | | LdapName serverEntryDn) |
| | |
| | | ERR_REPLICATION_UPDATING_ADS.get(adce.getMessageObject()), |
| | | ERROR_UPDATING_ADS, adce); |
| | | } |
| | | try |
| | | { |
| | | // Delete all contents from truststore. |
| | | printProgress(formatter.getFormattedWithPoints( |
| | | INFO_REPLICATION_REMOVE_TRUSTSTORE_CONTENTS.get())); |
| | | ServerDescriptor.cleanAdsTrustStore(adsCtx.getDirContext()); |
| | | printProgress(formatter.getFormattedDone()); |
| | | printlnProgress(); |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error removing contents of truststore: "+t, t); |
| | | throw new ReplicationCliException( |
| | | ERR_REPLICATION_UPDATING_ADS.get(t.toString()), |
| | | ERROR_UPDATING_ADS, t); |
| | | } |
| | | } |
| | | else if (disableAllBaseDns && |
| | | (disableReplicationServer || !server.isReplicationServer())) |