Browse Source

[175063] entry with escaped characters fails to import and index
If missing entry_id is found, skip it and continue reading the primary db to be
reindexed.

Noriko Hosoi 20 years ago
parent
commit
8905e03a05

+ 7 - 5
ldap/servers/slapd/back-ldbm/import-threads.c

@@ -986,6 +986,7 @@ void import_foreman(void *param)
     int ret = 0;
     struct attrinfo *parentid_ai;
     Slapi_PBlock *pb = slapi_pblock_new();
+	int shift = 0;
 
     PR_ASSERT(info != NULL);
     PR_ASSERT(inst != NULL);
@@ -1027,10 +1028,11 @@ void import_foreman(void *param)
         info->state = RUNNING;
 
         /* Read that entry from the cache */
-        fi = import_fifo_fetch(job, id, 0);
+        fi = import_fifo_fetch(job, id, 0, shift);
         if (! fi) {
-            import_log_notice(job, "ERROR: foreman fifo error");
-            goto error;
+            import_log_notice(job, "WARNING: entry id %d is missing", id);
+			shift++;
+            continue;
         }
 
         /* first, fill in any operational attributes */
@@ -1050,7 +1052,7 @@ void import_foreman(void *param)
              */
              if (job->flags & FLAG_ABORT) {       
                  goto error;
-                 }
+             }
 
             if (parent_status == IMPORT_ADD_OP_ATTRS_NO_PARENT) {
                 /* If this entry is a suffix entry, this is not a problem */
@@ -1268,7 +1270,7 @@ void import_worker(void *param)
             info->state = RUNNING;
 
             /* Read that entry from the cache */
-            fi = import_fifo_fetch(job, id, 1);
+            fi = import_fifo_fetch(job, id, 1, 0);
             ep = fi ? fi->entry : NULL;
             if (!ep) {
                 /* skipping an entry that turned out to be bad */

+ 2 - 2
ldap/servers/slapd/back-ldbm/import.c

@@ -91,7 +91,7 @@ static int import_fifo_init(ImportJob *job)
     return 0;
 }
 
-FifoItem *import_fifo_fetch(ImportJob *job, ID id, int worker)
+FifoItem *import_fifo_fetch(ImportJob *job, ID id, int worker, int shift)
 {
     int idx = id % job->fifo.size;
     FifoItem *fi;
@@ -102,7 +102,7 @@ FifoItem *import_fifo_fetch(ImportJob *job, ID id, int worker)
     return NULL;
     }
     if (fi->entry) {
-        if (id != fi->entry->ep_id)
+        if (id != fi->entry->ep_id - shift)
             fi = NULL;
         else if (worker) {
             if (fi->bad) return NULL;

+ 1 - 1
ldap/servers/slapd/back-ldbm/import.h

@@ -201,7 +201,7 @@ struct _import_worker_info {
 
 
 /* import.c */
-FifoItem *import_fifo_fetch(ImportJob *job, ID id, int worker);
+FifoItem *import_fifo_fetch(ImportJob *job, ID id, int worker, int shift);
 void import_free_job(ImportJob *job);
 void import_log_notice(ImportJob *job, char *format, ...);
 void import_abort_all(ImportJob *job, int wait_for_them);