On Jun 12, 2007, at 5:23 AM, Jeronimo Zucco wrote:
I'm trying to implement syncrepl in my openldap 2.3.35 without sucess. I tryed many (I sed: MANY) times to slacat, slapadd to slave for syn ldap servers, but for some reason with I don't know, the slave lost the sync.
Then I have to do the same thing ate night:
stop ldap master;
slapcat master
slapadd on the slave;
start master and start slave
This works about one hour, in the morning wasn't syncing again.
If i restart the slave ldap, then the changes on the master is replicated, but stops to sync "on line" after this.
I had troubles like this when the replication load was very large. The replica encountered a time limit and its search aborted.
Unfortunately, the only way to know for sure is to add logging to syncrepl.c. Without that you can only guess. I have done that with 2.4.4 test release, and I just now posted a patch: http://www.openldap.org/its/index.cgi/ Incoming?id=5014 Since it won't apply to 2.3, I append an untested patch for 2.3.24.
Donn Cave, donn@u.washington.edu
*** servers/slapd/syncrepl.c.orig Sat May 27 01:45:32 2006 --- servers/slapd/syncrepl.c Tue Jun 12 13:50:42 2007 *************** *** 627,633 **** struct sync_cookie syncCookie_req = { BER_BVNULL }; struct berval cookie = BER_BVNULL;
! int rc, err, i; ber_len_t len;
int rc_efree = 1; --- 627,633 ---- struct sync_cookie syncCookie_req = { BER_BVNULL }; struct berval cookie = BER_BVNULL;
! int rc, err, i, rrc; ber_len_t len;
int rc_efree = 1; *************** *** 646,651 **** --- 646,652 ---- BerVarray syncUUIDs = NULL; ber_tag_t si_tag;
+ rrc = LDAP_SUCCESS; if ( slapd_shutdown ) { rc = -2; goto done; *************** *** 669,674 **** --- 670,676 ---- while (( rc = ldap_result( si->si_ld, LDAP_RES_ANY, LDAP_MSG_ONE, tout_p, &res )) > 0 ) { + ldap_parse_result( si->si_ld, res, &rrc, 0, 0, 0, 0, 0 ); if ( slapd_shutdown ) { rc = -2; goto done; *************** *** 994,999 **** --- 996,1010 ---- }
done: + if ( rrc != LDAP_SUCCESS ) { + const char *errstr; + ldap_get_option( si->si_ld, LDAP_OPT_ERROR_NUMBER, &rrc ); + errstr = ldap_err2string( rrc ); + + Debug( LDAP_DEBUG_ANY, + "syncrepl %s result: %s\n", si->si_ridtxt, errstr, 0 ); + } + slap_sync_cookie_free( &syncCookie, 0 ); slap_sync_cookie_free( &syncCookie_req, 0 );