From 17d0158bf582511276dffccebc561d1511c95c45 Mon Sep 17 00:00:00 2001 From: Mark Reynolds Date: Apr 03 2013 20:51:01 +0000 Subject: Ticket 47311 - segfault in db2ldif(trigger by a cleanallruv task) Bug Description: If you run db2ldif while the server is stopped, and there is an unfinshed cleanAllRUV task, when the task finishes it tries to trim the changelog, but the changelog has been initialized yet. This leads to a crash when trying to trigger the trimming. Fix Description: Do not resume incomplete cleanAllRUV tasks when running db2ldif. https://fedorahosted.org/389/ticket/47311 Reviewed by: richm(Thanks!) --- diff --git a/ldap/servers/plugins/replication/repl5.h b/ldap/servers/plugins/replication/repl5.h index 92e7ac4..c7639e3 100644 --- a/ldap/servers/plugins/replication/repl5.h +++ b/ldap/servers/plugins/replication/repl5.h @@ -709,6 +709,7 @@ void repl5_set_debug_timeout(const char *val); /* temp hack XXX */ ReplicaId agmt_get_consumerRID(Repl_Agmt *ra); +PRBool ldif_dump_is_running(); 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); diff --git a/ldap/servers/plugins/replication/repl5_init.c b/ldap/servers/plugins/replication/repl5_init.c index cc73f5d..8471f00 100644 --- a/ldap/servers/plugins/replication/repl5_init.c +++ b/ldap/servers/plugins/replication/repl5_init.c @@ -657,6 +657,12 @@ check_for_ldif_dump(Slapi_PBlock *pb) static PRBool is_ldif_dump = PR_FALSE; +PRBool +ldif_dump_is_running() +{ + return is_ldif_dump; +} + int multimaster_start( Slapi_PBlock *pb ) { diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c index 68dc8f7..5a19833 100644 --- a/ldap/servers/plugins/replication/repl5_replica.c +++ b/ldap/servers/plugins/replication/repl5_replica.c @@ -1832,7 +1832,8 @@ replica_check_for_tasks(Replica *r, Slapi_Entry *e) { char **clean_vals; - if(e == NULL){ + if(e == NULL || ldif_dump_is_running() == PR_TRUE){ + /* If db2ldif is being run, do not check if there are incomplete tasks */ return; } /*