andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
dc8c34
From 963cac9f793f4cded71497b3dfb8a36a26cb6d29 Mon Sep 17 00:00:00 2001
dc8c34
From: Noriko Hosoi <nhosoi@redhat.com>
dc8c34
Date: Thu, 26 May 2016 17:58:51 -0700
dc8c34
Subject: [PATCH 382/382] Ticket #48854 - Running db2index with no options
dc8c34
 breaks replication
dc8c34
dc8c34
Bug Description: It was a bug in import_foreman which was not adjusted
dc8c34
when the backend RUV entry was redesigned.  The backend RUV entry has
dc8c34
no parent entry by nature.  But import-forman mistakenly skipped to
dc8c34
handle the entry.  If the 'db2index' command line is executed on a
dc8c34
consumer, this error message is logged.
dc8c34
dc8c34
error log on a consumer:
dc8c34
 reindex userRoot: WARNING: Skipping entry "nsuniqueid=ffffffff-ffffffff-
dc8c34
 ffffffff-ffffffff" which has no parent, ending at line 18 of file "id2entry.db"
dc8c34
 reindex userRoot: WARNING: bad entry: ID 18
dc8c34
dc8c34
Due to this skip, the RUV entry is not found at the following start up
dc8c34
and a new RUV is generated by the MMR plugin. And the supplier finds the
dc8c34
generation ID mismatch.
dc8c34
dc8c34
error log on a supplier:
dc8c34
 NSMMReplicationPlugin - agmt="cn=0_1" (HOST:PORT): The remote replica
dc8c34
 has a different database generation ID than the local database.  You
dc8c34
 may have to reinitialize the remote replica, or the local replica.
dc8c34
dc8c34
Fix Description: Even if there is no parent entry, do not skip the RUV
dc8c34
entry as done for the suffix entry.
dc8c34
dc8c34
https://fedorahosted.org/389/ticket/48854
dc8c34
dc8c34
Reviewed by wibrown@redhat.com (Thank you, William!)
dc8c34
dc8c34
(cherry picked from commit ba3b8442abd4bd558d5467b07880d1c89613df9a)
dc8c34
(cherry picked from commit 14bc6ce2ba0e0613949dd45696b933e5a332a51c)
dc8c34
(cherry picked from commit d45d040db7284d404fd5d594b83468e036fb003e)
dc8c34
---
dc8c34
 ldap/servers/slapd/back-ldbm/import-threads.c | 7 ++++---
dc8c34
 1 file changed, 4 insertions(+), 3 deletions(-)
dc8c34
dc8c34
diff --git a/ldap/servers/slapd/back-ldbm/import-threads.c b/ldap/servers/slapd/back-ldbm/import-threads.c
dc8c34
index 44fd35e..954abf2 100644
dc8c34
--- a/ldap/servers/slapd/back-ldbm/import-threads.c
dc8c34
+++ b/ldap/servers/slapd/back-ldbm/import-threads.c
dc8c34
@@ -2201,7 +2201,9 @@ import_foreman(void *param)
dc8c34
                  * we reject the entry but carry on since we've not stored
dc8c34
                  * anything related to this entry.
dc8c34
                  */
dc8c34
-                if (! slapi_be_issuffix(inst->inst_be, backentry_get_sdn(fi->entry))) {
dc8c34
+#define RUVRDN SLAPI_ATTR_UNIQUEID "=" RUV_STORAGE_ENTRY_UNIQUEID
dc8c34
+                if (!slapi_be_issuffix(inst->inst_be, backentry_get_sdn(fi->entry)) &&
dc8c34
+                    strcasecmp(backentry_get_ndn(fi->entry), RUVRDN) /* NOT nsuniqueid=ffffffff-... */) {
dc8c34
                     import_log_notice(job, "WARNING: Skipping entry \"%s\" "
dc8c34
                                       "which has no parent, ending at line %d "
dc8c34
                                       "of file \"%s\"",
dc8c34
@@ -2227,8 +2229,7 @@ import_foreman(void *param)
dc8c34
                     goto cont;      /* skip entry */
dc8c34
                 }
dc8c34
             }
dc8c34
-            if ((job->flags & FLAG_UPGRADEDNFORMAT) &&
dc8c34
-                (LDBM_ERROR_FOUND_DUPDN == ret)) {
dc8c34
+            if ((job->flags & FLAG_UPGRADEDNFORMAT) && (LDBM_ERROR_FOUND_DUPDN == ret)) {
dc8c34
                 /* 
dc8c34
                  * Duplicated DN is detected. 
dc8c34
                  *
dc8c34
-- 
dc8c34
2.4.11
dc8c34