[Fedora-directory-commits] ldapserver/ldap/servers/slapd add.c, 1.11, 1.12 bulk_import.c, 1.5, 1.6

Nathan Kinder (nkinder) fedora-directory-commits at redhat.com
Fri Jan 25 00:59:02 UTC 2008


Author: nkinder

Update of /cvs/dirsec/ldapserver/ldap/servers/slapd
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv20381/slapd

Modified Files:
	add.c bulk_import.c 
Log Message:
Resolves: 429793
Summary: Fixed crash in replication during bulk import.  Use bulk impport code more consistently.



Index: add.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/add.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- add.c	18 Oct 2007 00:08:34 -0000	1.11
+++ add.c	25 Jan 2008 00:59:00 -0000	1.12
@@ -772,25 +772,19 @@
     slapi_pblock_set(pb, SLAPI_BULK_IMPORT_STATE, &ret);
     ret = (*be->be_wire_import)(pb);
     if (ret != 0) {
-        if (ret != LDAP_BUSY) {
-            LDAPDebug(LDAP_DEBUG_ANY,
-                      "wire import: error during import (%d)\n",
-                      ret, 0, 0);
-        } else {
-            LDAPDebug(LDAP_DEBUG_TRACE,
-                      "wire import: asking client to wait before resuming (returning LDAP_BUSY)\n",
-                      0, 0, 0);
-        }
-        send_ldap_result(pb,
-			 LDAP_BUSY == ret ? LDAP_BUSY : LDAP_OPERATIONS_ERROR,
+        LDAPDebug(LDAP_DEBUG_ANY,
+                  "wire import: error during import (%d)\n",
+                  ret, 0, 0);
+        send_ldap_result(pb, LDAP_OPERATIONS_ERROR,
 			 NULL, NULL, 0, NULL);
+        /* It's our responsibility to free the entry if
+         * be_wire_import doesn't succeed. */
         slapi_entry_free(entry);
 
-		if (LDAP_BUSY != ret) {
-        	/* turn off fast replica init -- import is now aborted */
-        	pb->pb_conn->c_bi_backend = NULL;
-        	pb->pb_conn->c_flags &= ~CONN_FLAG_IMPORT;
-		}
+       	/* turn off fast replica init -- import is now aborted */
+       	pb->pb_conn->c_bi_backend = NULL;
+       	pb->pb_conn->c_flags &= ~CONN_FLAG_IMPORT;
+
         return;
     }
 


Index: bulk_import.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/bulk_import.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- bulk_import.c	10 Nov 2006 23:45:40 -0000	1.5
+++ bulk_import.c	25 Jan 2008 00:59:00 -0000	1.6
@@ -176,10 +176,11 @@
     rc = be->be_wire_import (pb);
     if (rc != 0)
     {
-        if (rc != LDAP_BUSY)
-			slapi_log_error(SLAPI_LOG_FATAL, NULL, "slapi_start_bulk_import: "
+        /* The caller will free the entry (e), so we just
+         * leave it alone here. */
+        slapi_log_error(SLAPI_LOG_FATAL, NULL, "slapi_start_bulk_import: "
                         "failed; error = %d\n", rc);
-        return (LDAP_BUSY == rc ? LDAP_BUSY : LDAP_OPERATIONS_ERROR);
+        return LDAP_OPERATIONS_ERROR;
     }
 
     return LDAP_SUCCESS;




More information about the Fedora-directory-commits mailing list