#include "config.h"
#include "ldap_rq.h"
+#ifdef LDAP_DEVEL
#define CHECK_CSN 1
+#endif
/* A modify request on a particular entry */
typedef struct modinst {
static int
syncprov_qplay( Operation *op, syncops *so )
{
- slap_overinst *on = LDAP_SLIST_FIRST(&so->s_op->o_extra)->oe_key;
syncres *sr;
int rc = 0;
{
so->s_flags |= PS_TASK_QUEUED;
so->s_inuse++;
- ldap_pvt_thread_pool_submit( &connection_pool,
+ ldap_pvt_thread_pool_submit( &connection_pool,
syncprov_qtask, so );
}
}
/* Allocate a record. UUIDs are not NUL-terminated. */
- se = ch_malloc( sizeof( slog_entry ) + opc->suuid.bv_len +
+ se = ch_malloc( sizeof( slog_entry ) + opc->suuid.bv_len +
op->o_csn.bv_len + 1 );
se->se_next = NULL;
se->se_tag = op->o_tag;
}
sl->sl_num++;
while ( sl->sl_num > sl->sl_size ) {
- int i, j;
+ int i;
se = sl->sl_head;
sl->sl_head = se->se_next;
for ( i=0; i<sl->sl_numcsns; i++ )
} else {
/* It's RefreshAndPersist, transition to Persist phase */
syncprov_sendinfo( op, rs, ( ss->ss_flags & SS_PRESENT ) ?
- LDAP_TAG_SYNC_REFRESH_PRESENT : LDAP_TAG_SYNC_REFRESH_DELETE,
+ LDAP_TAG_SYNC_REFRESH_PRESENT : LDAP_TAG_SYNC_REFRESH_DELETE,
( ss->ss_flags & SS_CHANGED ) ? &cookie : NULL,
1, NULL, 0 );
if ( !BER_BVISNULL( &cookie ))
/* 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_syslog_level,
+ "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;
send_ldap_result( op, rs );
return rs->sr_err;
}
- }
+ }
if ( BER_BVISEMPTY( &mincsn )) {
mincsn = maxcsn;
minsid = maxsid;
ConfigReply *cr
)
{
- slap_overinst *on = (slap_overinst *) be->bd_info;
- syncprov_info_t *si = (syncprov_info_t *)on->on_bi.bi_private;
+ slap_overinst *on = (slap_overinst *) be->bd_info;
+ syncprov_info_t *si = (syncprov_info_t *)on->on_bi.bi_private;
#ifdef SLAP_CONFIG_DELETE
syncops *so, *sonext;
#endif /* SLAP_CONFIG_DELETE */
overlay_unregister_control( be, LDAP_CONTROL_SYNC );
#endif /* SLAP_CONFIG_DELETE */
- return 0;
+ return 0;
}
static int