Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/replication In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv20667/plugins/replication
Modified Files: Tag: Directory71RtmBranch cl5_api.c repl5_replica_config.c Log Message: Resolves: #238630 Summary: ns-slapd sometimes fails with SIGSEGV when removing and recreating replica entry Description: applied the patch to Directory71RtmBranch
Index: cl5_api.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/cl5_api.c,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -u -r1.9 -r1.9.2.1 --- cl5_api.c 19 Apr 2005 22:07:32 -0000 1.9 +++ cl5_api.c 11 Jan 2008 22:01:44 -0000 1.9.2.1 @@ -6223,19 +6223,23 @@ _cl5WriteRUV (file, PR_FALSE); }
- /* close file */ + /* close the db */ if (file->db) file->db->close(file->db, 0);
if (file->flags & DB_FILE_DELETED) { + int rc = 0; + /* We need to use the libdb API to delete the files, otherwise we'll + * run into problems when we try to checkpoint transactions later. */ PR_snprintf(fullpathname, MAXPATHLEN, "%s/%s", s_cl5Desc.dbDir, file->name); - if (PR_Delete(fullpathname) != PR_SUCCESS) - { - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBCloseFile: " - "failed to remove (%s) file; NSPR error - %d\n", file->name, PR_GetError ()); - - } + rc = s_cl5Desc.dbEnv->dbremove(s_cl5Desc.dbEnv, 0, fullpathname, 0, 0); + if (rc != 0) + { + slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBCloseFile: " + "failed to remove (%s) file; libdb error - %d (%s)\n", + fullpathname, rc, db_strerror(rc)); + } }
/* slapi_ch_free accepts NULL pointer */
Index: repl5_replica_config.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_replica_config.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -r1.6 -r1.6.2.1 --- repl5_replica_config.c 19 Apr 2005 22:07:32 -0000 1.6 +++ repl5_replica_config.c 11 Jan 2008 22:01:44 -0000 1.6.2.1 @@ -455,9 +455,17 @@
if (mtnode_ext->replica) { + char ebuf[BUFSIZ]; + /* remove object from the hash */ r = (Replica*)object_get_data (mtnode_ext->replica); PR_ASSERT (r); + /* The changelog for this replica is no longer valid, so we should remove it. */ + slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "replica_config_delete: " + "Warning: The changelog for replica %s is no longer valid since " + "the replica config is being deleted. Removing the changelog.\n", + escape_string(slapi_sdn_get_dn(replica_get_root(r)),ebuf)); + cl5DeleteDBSync(mtnode_ext->replica); replica_delete_by_name (replica_get_name (r)); object_release (mtnode_ext->replica); mtnode_ext->replica = NULL;
389-commits@lists.fedoraproject.org