ldap/servers/plugins/replication/repl5.h | 1 +
ldap/servers/plugins/replication/repl5_protocol.c | 8 ++++++--
ldap/servers/plugins/replication/windowsrepl.h | 1 -
3 files changed, 7 insertions(+), 3 deletions(-)
New commits:
commit 9eb6f1b913555948f0251d4b7a494c989fb3ebf8
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Mon Feb 28 15:15:27 2011 -0700
Bug 676655 - winsync stops working after server restart
https://bugzilla.redhat.com/show_bug.cgi?id=676655
Resolves: bug 676655
Bug Description: winsync stops working after server restart
Reviewed by: nhosoi (Thanks!)
Branch: 389-ds-base-1.2.8
Fix Description: The problem really is that the server does not shutdown.
You have to kill -9 the server. When it restarts, the sync agreement is no
longer working. The problem was only observed on 32-bit platforms. The
size of the mmr Repl_Connection structure is different than the size of
the winsync Repl_Connection structure. The code was calling conn_delete()
on the winsync Repl_Connection*. We have to use windows_conn_delete instead.
The repl protocol code did not have a place to do that, so I added a new
delete_conn function pointer so that prot_free can call the right
conn_delete function.
Platforms tested: RHEL5 i386, RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry picked from commit 11f265bdd03832c6255cbf5ba3b79510346a3be0)
diff --git a/ldap/servers/plugins/replication/repl5.h
b/ldap/servers/plugins/replication/repl5.h
index 54d3952..d59169d 100644
--- a/ldap/servers/plugins/replication/repl5.h
+++ b/ldap/servers/plugins/replication/repl5.h
@@ -604,6 +604,7 @@ void windows_init_agreement_from_entry(Repl_Agmt *ra, Slapi_Entry
*e);
int windows_handle_modify_agreement(Repl_Agmt *ra, const char *type, Slapi_Entry *e);
void windows_agreement_delete(Repl_Agmt *ra);
Repl_Connection *windows_conn_new(Repl_Agmt *agmt);
+void windows_conn_delete(Repl_Connection *conn);
/* repl_session_plugin.c */
void repl_session_plugin_init();
diff --git a/ldap/servers/plugins/replication/repl5_protocol.c
b/ldap/servers/plugins/replication/repl5_protocol.c
index 8243688..c6aaba9 100644
--- a/ldap/servers/plugins/replication/repl5_protocol.c
+++ b/ldap/servers/plugins/replication/repl5_protocol.c
@@ -68,6 +68,7 @@ typedef struct repl_protocol
Private_Repl_Protocol *prp_active_protocol; /* Pointer to active protocol */
Repl_Agmt *agmt; /* The replication agreement we're servicing */
Repl_Connection *conn; /* Connection to remote server */
+ void (*delete_conn)(Repl_Connection *conn); /* mmr conn is different than winsync conn
*/
Object *replica_object; /* Local replica. If non-NULL, replica object is acquired */
int state;
int next_state;
@@ -127,11 +128,13 @@ prot_new(Repl_Agmt *agmt, int protocol_state)
{
rp->prp_incremental = private_protocol_factory(rp, PROTOCOL_5_INCREMENTAL);
rp->prp_total = private_protocol_factory(rp, PROTOCOL_5_TOTAL);
+ rp->delete_conn = conn_delete;
}
else if (get_agmt_agreement_type(agmt) == REPLICA_TYPE_WINDOWS)
{
rp->prp_incremental = private_protocol_factory(rp, PROTOCOL_WINDOWS_INCREMENTAL);
rp->prp_total = private_protocol_factory(rp, PROTOCOL_WINDOWS_TOTAL);
+ rp->delete_conn = windows_conn_delete;
}
/* XXXggood register callback handlers for entries updated, and
@@ -192,9 +195,10 @@ prot_free(Repl_Protocol **rpp)
{
object_release(rp->replica_object);
}
- if (NULL != rp->conn)
+ if ((NULL != rp->conn) && (NULL != rp->delete_conn))
{
- conn_delete(rp->conn);
+ rp->delete_conn(rp->conn);
+ rp->conn = NULL;
}
rp->prp_active_protocol = NULL;
PR_Unlock(rp->lock);
diff --git a/ldap/servers/plugins/replication/windowsrepl.h
b/ldap/servers/plugins/replication/windowsrepl.h
index 9ecf75d..158b0d1 100644
--- a/ldap/servers/plugins/replication/windowsrepl.h
+++ b/ldap/servers/plugins/replication/windowsrepl.h
@@ -90,7 +90,6 @@ void windows_private_set_one_way(const Repl_Agmt *ra, PRBool value);
/* in windows_connection.c */
ConnResult windows_conn_connect(Repl_Connection *conn);
void windows_conn_disconnect(Repl_Connection *conn);
-void windows_conn_delete(Repl_Connection *conn);
void windows_conn_get_error(Repl_Connection *conn, int *operation, int *error);
void windows_conn_set_error(Repl_Connection *conn, int error);
ConnResult windows_conn_send_add(Repl_Connection *conn, const char *dn, LDAPMod **attrs,