Browse Source

Ticket #48854 - Running db2index with no options breaks replication

Bug Description: It was a bug in import_foreman which was not adjusted
when the backend RUV entry was redesigned.  The backend RUV entry has
no parent entry by nature.  But import-forman mistakenly skipped to
handle the entry.  If the 'db2index' command line is executed on a
consumer, this error message is logged.

error log on a consumer:
 reindex userRoot: WARNING: Skipping entry "nsuniqueid=ffffffff-ffffffff-
 ffffffff-ffffffff" which has no parent, ending at line 18 of file "id2entry.db"
 reindex userRoot: WARNING: bad entry: ID 18

Due to this skip, the RUV entry is not found at the following start up
and a new RUV is generated by the MMR plugin. And the supplier finds the
generation ID mismatch.

error log on a supplier:
 NSMMReplicationPlugin - agmt="cn=0_1" (HOST:PORT): The remote replica
 has a different database generation ID than the local database.  You
 may have to reinitialize the remote replica, or the local replica.

Fix Description: Even if there is no parent entry, do not skip the RUV
entry as done for the suffix entry.

https://fedorahosted.org/389/ticket/48854

Reviewed by [email protected] (Thank you, William!)
Noriko Hosoi 9 years ago
parent
commit
ba3b8442ab
1 changed files with 4 additions and 3 deletions
  1. 4 3
      ldap/servers/slapd/back-ldbm/import-threads.c

+ 4 - 3
ldap/servers/slapd/back-ldbm/import-threads.c

@@ -2542,7 +2542,9 @@ import_foreman(void *param)
                  * we reject the entry but carry on since we've not stored
                  * anything related to this entry.
                  */
-                if (! slapi_be_issuffix(inst->inst_be, backentry_get_sdn(fi->entry))) {
+#define RUVRDN SLAPI_ATTR_UNIQUEID "=" RUV_STORAGE_ENTRY_UNIQUEID
+                if (!slapi_be_issuffix(inst->inst_be, backentry_get_sdn(fi->entry)) &&
+                    strcasecmp(backentry_get_ndn(fi->entry), RUVRDN) /* NOT nsuniqueid=ffffffff-... */) {
                     import_log_notice(job, "WARNING: Skipping entry \"%s\" "
                                       "which has no parent, ending at line %d "
                                       "of file \"%s\"",
@@ -2568,8 +2570,7 @@ import_foreman(void *param)
                     goto cont;      /* skip entry */
                 }
             }
-            if ((job->flags & FLAG_UPGRADEDNFORMAT) &&
-                (LDBM_ERROR_FOUND_DUPDN == ret)) {
+            if ((job->flags & FLAG_UPGRADEDNFORMAT) && (LDBM_ERROR_FOUND_DUPDN == ret)) {
                 /* 
                  * Duplicated DN is detected. 
                  *