Fixed slapd 3-way Multi-Master Replication (ITS#5238)
Fixed slapd hash collisions in index slots (ITS#5183)
Fixed slapd-bdb to report and fail on internal errors (ITS#5232)
+ Fixed slapd-hdb caching on rename ops (ITS#5221)
Fixed slapo-pcache op->o_abandon handling (ITS#5187)
Fixed slapo-ppolicy single password check on modify (ITS#5146)
Fixed slapo-ppolicy internal search (ITS#5235)
free( ei->bei_nrdn.bv_val );
ber_dupbv( &ei->bei_nrdn, nrdn );
- if ( !pei->bei_kids )
- pei->bei_state |= CACHE_ENTRY_NO_KIDS | CACHE_ENTRY_NO_GRANDKIDS;
-
#ifdef BDB_HIER
free( ei->bei_rdn.bv_val );
rdn.bv_len = ptr - rdn.bv_val;
}
ber_dupbv( &ei->bei_rdn, &rdn );
- pei->bei_ckids--;
- if ( pei->bei_dkids ) pei->bei_dkids--;
+
+ /* If new parent, decrement kid counts */
+ if ( ein ) {
+ pei->bei_ckids--;
+ if ( pei->bei_dkids ) {
+ pei->bei_dkids--;
+ if ( pei->bei_dkids < 2 )
+ pei->bei_state |= CACHE_ENTRY_NO_KIDS | CACHE_ENTRY_NO_GRANDKIDS;
+ }
+ }
#endif
if (!ein) {
ei->bei_parent = ein;
bdb_cache_entryinfo_unlock( pei );
bdb_cache_entryinfo_lock( ein );
- }
- /* parent now has kids */
- if ( ein->bei_state & CACHE_ENTRY_NO_KIDS )
- ein->bei_state ^= CACHE_ENTRY_NO_KIDS;
+ /* new parent now has kids */
+ if ( ein->bei_state & CACHE_ENTRY_NO_KIDS )
+ ein->bei_state ^= CACHE_ENTRY_NO_KIDS;
+ /* grandparent has grandkids */
+ if ( ein->bei_parent )
+ ein->bei_parent->bei_state &= ~CACHE_ENTRY_NO_GRANDKIDS;
#ifdef BDB_HIER
- /* parent might now have grandkids */
- if ( ein->bei_state & CACHE_ENTRY_NO_GRANDKIDS &&
- !(ei->bei_state & (CACHE_ENTRY_NO_KIDS)))
- ein->bei_state ^= CACHE_ENTRY_NO_GRANDKIDS;
+ /* parent might now have grandkids */
+ if ( ein->bei_state & CACHE_ENTRY_NO_GRANDKIDS &&
+ !(ei->bei_state & CACHE_ENTRY_NO_KIDS))
+ ein->bei_state ^= CACHE_ENTRY_NO_GRANDKIDS;
- {
- /* Record the generation number of this change */
- ldap_pvt_thread_mutex_lock( &bdb->bi_modrdns_mutex );
- bdb->bi_modrdns++;
- ei->bei_modrdns = bdb->bi_modrdns;
- ldap_pvt_thread_mutex_unlock( &bdb->bi_modrdns_mutex );
+ ein->bei_ckids++;
+ if ( ein->bei_dkids ) ein->bei_dkids++;
+#endif
}
- ein->bei_ckids++;
- if ( ein->bei_dkids ) ein->bei_dkids++;
+
+#ifdef BDB_HIER
+ /* Record the generation number of this change */
+ ldap_pvt_thread_mutex_lock( &bdb->bi_modrdns_mutex );
+ bdb->bi_modrdns++;
+ ei->bei_modrdns = bdb->bi_modrdns;
+ ldap_pvt_thread_mutex_unlock( &bdb->bi_modrdns_mutex );
#endif
+
avl_insert( &ein->bei_kids, ei, bdb_rdn_cmp, avl_dup_error );
bdb_cache_entryinfo_unlock( ein );
return rc;