[Fedora-directory-commits] ldapserver/ldap/servers/plugins/replication cl5_api.c, 1.16, 1.17 repl5_replica_config.c, 1.7, 1.8
Nathan Kinder (nkinder)
fedora-directory-commits at redhat.com
Fri Oct 12 17:22:56 UTC 2007
- Previous message (by thread): [Fedora-directory-commits] ldapserver/ldap/servers/slapd plugin_internal_op.c, 1.7, 1.8
- Next message (by thread): [Fedora-directory-commits] ldapserver/ldap/servers/slapd slap.h, 1.27, 1.28 slapi-private.h, 1.17, 1.18 vattr_spi.h, 1.5, 1.6 filterentry.c, 1.5, 1.6 vattr.c, 1.6, 1.7
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: nkinder
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/replication
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv18707
Modified Files:
cl5_api.c repl5_replica_config.c
Log Message:
Resolves: 238630
Summary: Remove changelog db file when replica config is removed.
Index: cl5_api.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/cl5_api.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- cl5_api.c 24 Sep 2007 23:39:22 -0000 1.16
+++ cl5_api.c 12 Oct 2007 17:22:54 -0000 1.17
@@ -6391,20 +6391,24 @@
_cl5WriteRUV (file, PR_FALSE);
}
- /* close file */
+ /* close the db */
if (file->db)
file->db->close(file->db, 0);
if (file->flags & DB_FILE_DELETED)
- {
- PR_snprintf(fullpathname, MAXPATHLEN, "%s/%s", s_cl5Desc.dbDir, file->name);
- if (PR_Delete(fullpathname) != PR_SUCCESS)
+ {
+ 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);
+ 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; NSPR error - %d\n", file->name, PR_GetError ());
-
- }
- }
+ slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBCloseFile: "
+ "failed to remove (%s) file; libdb error - %d (%s)\n", file->name,
+ rc, dblayer_strerror(rc));
+ }
+ }
/* slapi_ch_free accepts NULL pointer */
slapi_ch_free ((void**)&file->name);
Index: repl5_replica_config.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_replica_config.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- repl5_replica_config.c 10 Nov 2006 23:45:17 -0000 1.7
+++ repl5_replica_config.c 12 Oct 2007 17:22:54 -0000 1.8
@@ -460,9 +460,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;
- Previous message (by thread): [Fedora-directory-commits] ldapserver/ldap/servers/slapd plugin_internal_op.c, 1.7, 1.8
- Next message (by thread): [Fedora-directory-commits] ldapserver/ldap/servers/slapd slap.h, 1.27, 1.28 slapi-private.h, 1.17, 1.18 vattr_spi.h, 1.5, 1.6 filterentry.c, 1.5, 1.6 vattr.c, 1.6, 1.7
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Fedora-directory-commits
mailing list