#ifdef LDAP_SYNC
Operation* ps_list;
+ int rc;
+ EntryInfo *suffix_ei;
+ Entry *ctxcsn_e;
+ int ctxcsn_added = 0;
#endif
#ifdef NEW_LOGGING
ldap_pvt_thread_mutex_unlock( &bdb->bi_lastid_mutex );
#endif
+#ifdef LDAP_SYNC
+ rc = bdb_csn_commit( op, rs, ltid, ei, &suffix_ei, &ctxcsn_e, &ctxcsn_added, locker );
+ switch ( rc ) {
+ case BDB_CSN_ABORT :
+ goto return_results;
+ case BDB_CSN_RETRY :
+ goto retry;
+ }
+#endif
+
if( op->o_noop ) {
if ( ( rs->sr_err = TXN_ABORT( ltid ) ) != 0 ) {
rs->sr_text = "txn_abort (no-op) failed";
rs->sr_err = LDAP_SUCCESS;
}
} else {
+#ifdef LDAP_SYNC
+ struct berval ctx_nrdn;
+#endif
+
bdb_cache_delete( &bdb->bi_cache, e, bdb->bi_dbenv,
locker, &lock );
+
+#ifdef LDAP_SYNC
+ if ( ctxcsn_added ) {
+ ctx_nrdn.bv_val = "cn=ldapsync";
+ ctx_nrdn.bv_len = strlen( ctx_nrdn.bv_val );
+ bdb_cache_add( bdb, suffix_ei, ctxcsn_e, &ctx_nrdn, locker );
+ }
+#endif
+
rs->sr_err = TXN_COMMIT( ltid, 0 );
}
ltid = NULL;
#include "ldap_pvt.h"
#include "slap.h"
+#ifdef LDAP_SYNC
+#include "lutil.h"
+#endif
+
#ifdef LDAP_SLAPI
#include "slapi.h"
#endif
if ( !op->o_bd->be_update_ndn.bv_len || repl_user )
#endif
{
+
+#ifdef LDAP_SYNC
+ if ( !repl_user ) {
+ struct berval csn = { 0 , NULL };
+ char csnbuf[ LDAP_LUTIL_CSNSTR_BUFSIZE ];
+ slap_get_csn( op, csnbuf, sizeof(csnbuf), &csn, 1 );
+ }
+#endif
+
if ( (op->o_bd->be_delete)( op, rs ) == 0 ) {
#ifdef SLAPD_MULTIMASTER
if ( !op->o_bd->be_update_ndn.bv_len || !repl_user )
#endif /* defined( LDAP_SLAPI ) */
cleanup:
+
+#ifdef LDAP_SYNC
+ slap_graduate_commit_csn( op );
+#endif
+
op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx );
op->o_tmpfree( op->o_req_ndn.bv_val, op->o_tmpmemctx );
return rs->sr_err;