ldap/servers/plugins/replication/repl5_total.c | 5 +++--
ldap/servers/slapd/plugin.c | 22 +++++++++-------------
2 files changed, 12 insertions(+), 15 deletions(-)
New commits:
commit e6ba94f61c4105403c46c76cd192061955bfd71b
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Mon May 16 17:08:21 2016 -0700
Ticket #48837 - Replication: total init aborted
Bug Description: Commit 2ecc93781abc786be6a8b8443faf2598a6c30f97 to fix
ticket 48822 broke the logic and forced plugin_call_exop_plugins to
return an error even if the underlying extended plugin were successful.
Fix Description:
In plugin_call_exop_plugins,
- this patch honours the return value from the plugins.
- LDAP_SUCCESS is translated to SLAPI_PLUGIN_EXTENDED_SENT_RESULT.
The extop plugin multimaster_extop_NSDS50ReplicationEntry is fixed to
return SLAPI_PLUGIN_EXTENDED_SENT_RESULT in the case of success.
https://fedorahosted.org/389/ticket/48837
Reviewed by lkrispen(a)redhat.com and wibrown(a)redhat.com (Thank you, Ludwig and
William!)
diff --git a/ldap/servers/plugins/replication/repl5_total.c
b/ldap/servers/plugins/replication/repl5_total.c
index 7f7bb15..12b244d 100644
--- a/ldap/servers/plugins/replication/repl5_total.c
+++ b/ldap/servers/plugins/replication/repl5_total.c
@@ -866,8 +866,7 @@ multimaster_extop_NSDS50ReplicationEntry(Slapi_PBlock *pb)
rc, connid, opid);
}
- if (rc != 0)
- {
+ if (rc) {
/* just disconnect from the supplier. bulk import is stopped when
connection object is destroyed */
slapi_pblock_get (pb, SLAPI_CONNECTION, &conn);
@@ -881,6 +880,8 @@ multimaster_extop_NSDS50ReplicationEntry(Slapi_PBlock *pb)
{
slapi_entry_free (e);
}
+ } else {
+ rc = SLAPI_PLUGIN_EXTENDED_SENT_RESULT;
}
return rc;
diff --git a/ldap/servers/slapd/plugin.c b/ldap/servers/slapd/plugin.c
index f196d2c..5d63baa 100644
--- a/ldap/servers/slapd/plugin.c
+++ b/ldap/servers/slapd/plugin.c
@@ -527,23 +527,19 @@ plugin_determine_exop_plugins( const char *oid, struct slapdplugin
**plugin)
int
plugin_call_exop_plugins( Slapi_PBlock *pb, struct slapdplugin *p )
{
- int rc = LDAP_SUCCESS;
- int lderr = SLAPI_PLUGIN_EXTENDED_NOT_HANDLED;
-
+ int rc;
slapi_pblock_set( pb, SLAPI_PLUGIN, p );
set_db_default_result_handlers( pb );
- if ( (rc = (*p->plg_exhandler)( pb )) == SLAPI_PLUGIN_EXTENDED_SENT_RESULT ) {
- return( rc ); /* result sent */
- } else if ( rc != SLAPI_PLUGIN_EXTENDED_NOT_HANDLED ) {
- /*
- * simple merge: report last real error
+ rc = (*p->plg_exhandler)( pb );
+ if (LDAP_SUCCESS == rc) {
+ /*
+ * Some plugin may return LDAP_SUCCESS in the success case.
+ * It is translated to SLAPI_PLUGIN_EXTENDED_SENT_RESULT to
+ * reduce the unnecessary error logs.
*/
- if ( rc != LDAP_SUCCESS ) {
- lderr = rc;
- }
+ rc = SLAPI_PLUGIN_EXTENDED_SENT_RESULT;
}
-
- return( lderr );
+ return (rc);
}