[Date Prev][Date Next] [Chronological] [Thread] [Top]

(ITS#4915) Syncrepl task exits are not logged



Full_Name: Sean Burford
Version: 2.3.32
OS: Linux
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (65.57.245.11)


It is hard to tell when the syncrepl task has exited.  The attached patch adds
logging of syncrepl hard and soft failures.

Using this patch, it is easier to spot unfortunate conditions where recoverable
failures are treated as hard failures, for example the third line below shows
that a (temporarily) unavailable kerberos credential cache causes a hard
failure:
GSSAPI Error: Miscellaneous failure (No credentials cache found)
do_syncrep1: rid 123 ldap_sasl_interactive_bind_s failed (-2)
do_syncrepl: rid 123 hard failure 

Hmm, no attachment because the FTP server returns:
200 PORT command successful.
150 Opening ASCII mode data connection for
'openldap-2.3.32-syncrepl-log-failure.patch'.
##
452 Error writing file: No space left on device.
1104 bytes sent in 0.00011 seconds (1e+04 Kbytes/s)

The patch was:
*** openldap-2.3.32.orig/servers/slapd/syncrepl.c       Wed Apr  4 17:21:31
2007
--- openldap-2.3.32/servers/slapd/syncrepl.c    Wed Apr  4 17:55:58 2007
***************
*** 1147,1159 ****
--- 1147,1169 ----
                }
  
                if ( !si->si_retrynum || si->si_retrynum[i] == RETRYNUM_TAIL )
{
+                       Debug( LDAP_DEBUG_ANY,
+                               "do_syncrepl: rid %03d hard failure\n",
+                               si->si_rid, 0, 0 );
                        ldap_pvt_runqueue_remove( &slapd_rq, rtask );
                } else if ( RETRYNUM_VALID( si->si_retrynum[i] ) ) {
                        if ( si->si_retrynum[i] > 0 )
                                si->si_retrynum[i]--;
+                       Debug( LDAP_DEBUG_ANY,
+                               "do_syncrepl: rid %03d soft failure,
rescheduling (retries left: %d)\n",
+                               si->si_rid, si->si_retrynum[i], 0 );
                        rtask->interval.tv_sec = si->si_retryinterval[i];
                        ldap_pvt_runqueue_resched( &slapd_rq, rtask, 0 );
                        slap_wake_listener();
+               } else {
+                       Debug( LDAP_DEBUG_ANY,
+                               "do_syncrepl: rid %03d soft failure,
rescheduling\n",
+                               si->si_rid, 0, 0 );
                }
        }