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

(ITS#8527) Improve logging for CSN issues



Full_Name: Quanah Gibson-Mount
Version: 2.4.44
OS: N/A
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (47.208.148.26)


Unfortunately, it frequently is the case that a consumer CSN ends up ahead of
the provider CSN.  This can occur for a variety of reasons, but in the case of
databases holding multiple CSNs from the same serverID (delta-syncrepl and
subordinate databases are two examples of where this can be the case), the info
spit out is somewhat lacking:

Oct 28 15:49:55 XXXXXXX slapd[6463]: conn=1819162 op=2 SEARCH RESULT tag=101
err=53  nentries=0 text=consumer state is newer than provider!

It would be exceedingly useful to have better detail than this, so we can see
the consumer CSN and the server CSN that are being compared.

Something like:

diff --git a/servers/slapd/overlays/syncprov.c
b/servers/slapd/overlays/syncprov.c
index f7e422d..c6ef4df 100644
--- a/servers/slapd/overlays/syncprov.c
+++ b/servers/slapd/overlays/syncprov.c
@@ -2654,6 +2654,11 @@ syncprov_op_search( Operation *op, SlapReply *rs )
                        /* our state is older, complain to consumer */
                                rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
                                rs->sr_text = "consumer state is newer than
provider!";
+
+                               Log4( LDAP_DEBUG_SYNC, LDAP_LEVEL_INFO,
+                                       "consumer %d state %s is newer than
provider %d state %s\n",
+                                       sids[i], srs->sr_state.ctxcsn[i].bv_val,
sids[j], /* == slap_serverID */
+                                       ctxcsn[j].bv_val);
 bailout:
                                if ( sop ) {
                                        syncops **sp = &si->si_ops;