]> git.sur5r.net Git - openldap/commitdiff
CSN, LDAPsync and related fixes
authorKurt Zeilenga <kurt@openldap.org>
Mon, 30 Aug 2004 04:40:16 +0000 (04:40 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 30 Aug 2004 04:40:16 +0000 (04:40 +0000)
servers/slapd/back-bdb/ctxcsn.c
servers/slapd/back-bdb/id2entry.c
servers/slapd/back-bdb/search.c

index 7c2b31ec366244d775d8dafc561c6a3b0ed7ef76..1127995de39c5344c260871abe6c3dc270687bbe 100644 (file)
@@ -58,6 +58,16 @@ bdb_csn_commit(
 
        rc =  bdb_dn2entry( op, tid, &op->o_bd->be_context_csn, &ctxcsn_ei,
                        1, locker, &ctxcsn_lock );
+       switch( rc ) {
+       case 0:
+       case DB_NOTFOUND:
+               break;
+       case DB_LOCK_DEADLOCK:
+       case DB_LOCK_NOTGRANTED:
+               return BDB_CSN_RETRY;
+       default:
+               return BDB_CSN_ABORT;
+       }
        
        *ctxcsn_e = ctxcsn_ei->bei_e;
 
index 2635e1d42400b5ddf3a6020fa425853bfbc5ca34..05501b0e421fb05aabd51ac94c74fc800e581110 100644 (file)
@@ -386,6 +386,7 @@ return_results:
                        if ( op && !boi ) {
                                boi = op->o_tmpcalloc(1,sizeof(struct bdb_op_info),op->o_tmpmemctx);
                                boi->boi_lock = lock;
+                               boi->boi_bdb = op->o_bd;
                                op->o_private = boi;
                        }
 
index 5090c695f0f26de62b322afa6e76a144c476461f..b3298840bdd5669952627615059dad433176bfea 100644 (file)
@@ -532,7 +532,7 @@ bdb_do_search( Operation *op, SlapReply *rs, Operation *sop,
                }
        }
 
-       if ( opinfo ) {
+       if ( opinfo && opinfo->boi_txn ) {
                ltid = opinfo->boi_txn;
                locker = TXN_ID( ltid );
        } else {