This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.3.6
in repository 389-ds-base.
commit 9141829a0490cc5b37644117ef54afdce2139f6d
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Thu Nov 2 12:55:11 2017 -0400
Ticket 49439 - cleanallruv is not logging information
Bug Description: During the logging refector effro from ticket 48978
a mistake was made and cleanruv_log() was using
LOG_NOTICE (which is not a true log level), it was
supposed to be SLAPI_LOG_NOTICE.
We also use DEBUG defines to contorl the logging for
debug builds
Fix Description: Remove the LDAP_DEBUG defines in cleanruv_log, and set
the correct logging severity level.
https://pagure.io/389-ds-base/issue/49439
Reviewed by: firstyear(Thanks!)
(cherry picked from commit e1f866a5e3ccce8e061e361c0e3dd11175a8acf2)
---
.../plugins/replication/repl5_replica_config.c | 101 +++++++++++----------
1 file changed, 51 insertions(+), 50 deletions(-)
diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c
b/ldap/servers/plugins/replication/repl5_replica_config.c
index f09055b..1543910 100644
--- a/ldap/servers/plugins/replication/repl5_replica_config.c
+++ b/ldap/servers/plugins/replication/repl5_replica_config.c
@@ -1936,12 +1936,13 @@ replica_cleanallruv_thread(void *arg)
/*
* need to sleep between passes
*/
- cleanruv_log(data->task, data->rid, CLEANALLRUV_ID, LOG_NOTICE, "Not
all replicas have received the "
- "cleanallruv extended op, retrying in %d seconds",interval);
- if(!slapi_is_shutting_down()){
- PR_Lock( notify_lock );
- PR_WaitCondVar( notify_cvar, PR_SecondsToInterval(interval) );
- PR_Unlock( notify_lock );
+ cleanruv_log(data->task, data->rid, CLEANALLRUV_ID, SLAPI_LOG_NOTICE,
"Not all replicas have received the "
+ "cleanallruv extended op, retrying in %d seconds",
+ interval);
+ if (!slapi_is_shutting_down()) {
+ PR_Lock(notify_lock);
+ PR_WaitCondVar(notify_cvar, PR_SecondsToInterval(interval));
+ PR_Unlock(notify_lock);
}
if(interval < 14400){ /* 4 hour max */
interval = interval * 2;
@@ -1977,8 +1978,8 @@ replica_cleanallruv_thread(void *arg)
found_dirty_rid = 0;
} else {
found_dirty_rid = 1;
- cleanruv_log(data->task, data->rid, CLEANALLRUV_ID, LOG_NOTICE,
"Replica is not cleaned yet (%s)",
- agmt_get_long_name(agmt));
+ cleanruv_log(data->task, data->rid, CLEANALLRUV_ID,
SLAPI_LOG_NOTICE, "Replica is not cleaned yet (%s)",
+ agmt_get_long_name(agmt));
break;
}
agmt_obj = agmtlist_get_next_agreement_for_replica (data->replica,
agmt_obj);
@@ -1994,12 +1995,13 @@ replica_cleanallruv_thread(void *arg)
/*
* Need to sleep between passes unless we are shutting down
*/
- if (!slapi_is_shutting_down()){
- cleanruv_log(data->task, data->rid, CLEANALLRUV_ID, LOG_NOTICE,
"Replicas have not been cleaned yet, "
- "retrying in %d seconds", interval);
- PR_Lock( notify_lock );
- PR_WaitCondVar( notify_cvar, PR_SecondsToInterval(interval) );
- PR_Unlock( notify_lock );
+ if (!slapi_is_shutting_down()) {
+ cleanruv_log(data->task, data->rid, CLEANALLRUV_ID, SLAPI_LOG_NOTICE,
"Replicas have not been cleaned yet, "
+
"retrying in %d seconds",
+ interval);
+ PR_Lock(notify_lock);
+ PR_WaitCondVar(notify_cvar, PR_SecondsToInterval(interval));
+ PR_Unlock(notify_lock);
}
if(interval < 14400){ /* 4 hour max */
@@ -2033,11 +2035,11 @@ done:
/*
* Shutdown or abort
*/
- if(!is_task_aborted(data->rid) || slapi_is_shutting_down()){
- cleanruv_log(data->task, data->rid, CLEANALLRUV_ID, LOG_NOTICE,
- "Server shutting down. Process will resume at server
startup");
+ if (!is_task_aborted(data->rid) || slapi_is_shutting_down()) {
+ cleanruv_log(data->task, data->rid, CLEANALLRUV_ID, SLAPI_LOG_NOTICE,
+ "Server shutting down. Process will resume at server
startup");
} else {
- cleanruv_log(data->task, data->rid, CLEANALLRUV_ID, LOG_NOTICE,
"Task aborted for rid(%d).",data->rid);
+ cleanruv_log(data->task, data->rid, CLEANALLRUV_ID, SLAPI_LOG_NOTICE,
"Task aborted for rid(%d).", data->rid);
delete_cleaned_rid_config(data);
remove_cleaned_rid(data->rid);
}
@@ -2205,7 +2207,7 @@ check_replicas_are_done_cleaning(cleanruv_data *data )
break;
}
- cleanruv_log(data->task, data->rid, CLEANALLRUV_ID, LOG_NOTICE,
+ cleanruv_log(data->task, data->rid, CLEANALLRUV_ID, SLAPI_LOG_NOTICE,
"Not all replicas finished cleaning, retrying in %d
seconds",
interval);
if(!slapi_is_shutting_down()){
@@ -2315,12 +2317,12 @@ check_replicas_are_done_aborting(cleanruv_data *data )
if(not_all_aborted == 0){
break;
}
- cleanruv_log(data->task, data->rid, ABORT_CLEANALLRUV_ID, LOG_NOTICE,
- "Not all replicas finished aborting, retrying in %d
seconds",interval);
- if(!slapi_is_shutting_down()){
- PR_Lock( notify_lock );
- PR_WaitCondVar( notify_cvar, PR_SecondsToInterval(interval) );
- PR_Unlock( notify_lock );
+ cleanruv_log(data->task, data->rid, ABORT_CLEANALLRUV_ID,
SLAPI_LOG_NOTICE,
+ "Not all replicas finished aborting, retrying in %d
seconds", interval);
+ if (!slapi_is_shutting_down()) {
+ PR_Lock(notify_lock);
+ PR_WaitCondVar(notify_cvar, PR_SecondsToInterval(interval));
+ PR_Unlock(notify_lock);
}
if(interval < 14400){ /* 4 hour max */
interval = interval * 2;
@@ -2362,8 +2364,8 @@ check_agmts_are_caught_up(cleanruv_data *data, char *maxcsn)
not_all_caughtup = 0;
} else {
not_all_caughtup = 1;
- cleanruv_log(data->task, data->rid, CLEANALLRUV_ID, LOG_NOTICE,
- "Replica not caught up
(%s)",agmt_get_long_name(agmt));
+ cleanruv_log(data->task, data->rid, CLEANALLRUV_ID,
SLAPI_LOG_NOTICE,
+ "Replica not caught up (%s)",
agmt_get_long_name(agmt));
break;
}
agmt_obj = agmtlist_get_next_agreement_for_replica (data->replica,
agmt_obj);
@@ -2372,12 +2374,12 @@ check_agmts_are_caught_up(cleanruv_data *data, char *maxcsn)
if(not_all_caughtup == 0 || is_task_aborted(data->rid) ){
break;
}
- cleanruv_log(data->task, data->rid, CLEANALLRUV_ID, LOG_NOTICE,
- "Not all replicas caught up, retrying in %d
seconds",interval);
- if(!slapi_is_shutting_down()){
- PR_Lock( notify_lock );
- PR_WaitCondVar( notify_cvar, PR_SecondsToInterval(interval) );
- PR_Unlock( notify_lock );
+ cleanruv_log(data->task, data->rid, CLEANALLRUV_ID, SLAPI_LOG_NOTICE,
+ "Not all replicas caught up, retrying in %d seconds",
interval);
+ if (!slapi_is_shutting_down()) {
+ PR_Lock(notify_lock);
+ PR_WaitCondVar(notify_cvar, PR_SecondsToInterval(interval));
+ PR_Unlock(notify_lock);
}
if(interval < 14400){ /* 4 hour max */
interval = interval * 2;
@@ -2422,8 +2424,8 @@ check_agmts_are_alive(Replica *replica, ReplicaId rid, Slapi_Task
*task)
not_all_alive = 0;
} else {
not_all_alive = 1;
- cleanruv_log(task, rid, CLEANALLRUV_ID, LOG_NOTICE, "Replica not
online (%s)",
- agmt_get_long_name(agmt));
+ cleanruv_log(task, rid, CLEANALLRUV_ID, SLAPI_LOG_NOTICE, "Replica
not online (%s)",
+ agmt_get_long_name(agmt));
break;
}
agmt_obj = agmtlist_get_next_agreement_for_replica (replica, agmt_obj);
@@ -2432,8 +2434,8 @@ check_agmts_are_alive(Replica *replica, ReplicaId rid, Slapi_Task
*task)
if(not_all_alive == 0 || is_task_aborted(rid)){
break;
}
- cleanruv_log(task, rid, CLEANALLRUV_ID, LOG_NOTICE, "Not all replicas
online, retrying in %d seconds...",
- interval);
+ cleanruv_log(task, rid, CLEANALLRUV_ID, SLAPI_LOG_NOTICE, "Not all replicas
online, retrying in %d seconds...",
+ interval);
if(!slapi_is_shutting_down()){
PR_Lock( notify_lock );
@@ -3204,11 +3206,11 @@ replica_abort_task_thread(void *arg)
/*
* Need to sleep between passes. unless we are shutting down
*/
- if (!slapi_is_shutting_down()){
- cleanruv_log(data->task, data->rid, ABORT_CLEANALLRUV_ID, LOG_NOTICE,
"Retrying in %d seconds",interval);
- PR_Lock( notify_lock );
- PR_WaitCondVar( notify_cvar, PR_SecondsToInterval(interval) );
- PR_Unlock( notify_lock );
+ if (!slapi_is_shutting_down()) {
+ cleanruv_log(data->task, data->rid, ABORT_CLEANALLRUV_ID,
SLAPI_LOG_NOTICE, "Retrying in %d seconds", interval);
+ PR_Lock(notify_lock);
+ PR_WaitCondVar(notify_cvar, PR_SecondsToInterval(interval));
+ PR_Unlock(notify_lock);
}
if(interval < 14400){ /* 4 hour max */
@@ -3326,9 +3328,10 @@ replica_cleanallruv_send_extop(Repl_Agmt *ra, cleanruv_data
*clean_data, int che
/* extop was accepted */
rc = 0;
} else {
- cleanruv_log(clean_data->task, clean_data->rid, CLEANALLRUV_ID,
LOG_NOTICE,
- "Replica %s does not support the CLEANALLRUV task.
"
- "Sending replica CLEANRUV task...",
slapi_sdn_get_dn(agmt_get_dn_byref(ra)));
+ cleanruv_log(clean_data->task, clean_data->rid, CLEANALLRUV_ID,
SLAPI_LOG_NOTICE,
+ "Replica %s does not support the CLEANALLRUV task.
"
+ "Sending replica CLEANRUV task...",
+ slapi_sdn_get_dn(agmt_get_dn_byref(ra)));
/*
* Ok, this replica doesn't know about CLEANALLRUV, so just
manually
* add the CLEANRUV task to the replica.
@@ -3493,9 +3496,9 @@ replica_cleanallruv_check_maxcsn(Repl_Agmt *agmt, char *basedn, char
*rid_text,
csn_init_by_string(repl_max, remote_maxcsn);
if(csn_compare (repl_max, max) < 0){
/* we are not caught up yet, free, and return */
- cleanruv_log(task, atoi(rid_text), CLEANALLRUV_ID, LOG_NOTICE,
- "Replica maxcsn (%s) is not caught up with deleted
replica's maxcsn(%s)",
- remote_maxcsn, maxcsn);
+ cleanruv_log(task, atoi(rid_text), CLEANALLRUV_ID,
SLAPI_LOG_NOTICE,
+ "Replica maxcsn (%s) is not caught up with
deleted replica's maxcsn(%s)",
+ remote_maxcsn, maxcsn);
rc = -1;
} else {
/* ok this replica is caught up */
@@ -3666,7 +3669,6 @@ stop_ruv_cleaning()
void
cleanruv_log(Slapi_Task *task, int rid, char *task_type, int sev_level, char *fmt, ...)
{
-#ifdef LDAP_DEBUG
va_list ap1;
va_list ap2;
va_list ap3;
@@ -3691,7 +3693,6 @@ cleanruv_log(Slapi_Task *task, int rid, char *task_type, int
sev_level, char *fm
va_end(ap2);
va_end(ap3);
va_end(ap4);
-#endif
}
char *
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.