mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-25 17:19:43 -05:00
ITS#3309 fix syncrepl psearch propagation of Delete operations
This commit is contained in:
parent
17d920063a
commit
5c1c0902b4
1 changed files with 19 additions and 0 deletions
|
|
@ -19,6 +19,8 @@
|
|||
#include <stdio.h>
|
||||
#include <ac/string.h>
|
||||
|
||||
#include "lutil.h"
|
||||
|
||||
#include "back-bdb.h"
|
||||
#include "external.h"
|
||||
|
||||
|
|
@ -47,6 +49,8 @@ bdb_delete( Operation *op, SlapReply *rs )
|
|||
EntryInfo *suffix_ei;
|
||||
Entry *ctxcsn_e;
|
||||
int ctxcsn_added = 0;
|
||||
char csnbuf[ LDAP_LUTIL_CSNSTR_BUFSIZE ];
|
||||
struct berval csn;
|
||||
|
||||
LDAPControl **preread_ctrl = NULL;
|
||||
LDAPControl *ctrls[SLAP_MAX_RESPONSE_CONTROLS];
|
||||
|
|
@ -65,6 +69,8 @@ bdb_delete( Operation *op, SlapReply *rs )
|
|||
op->o_req_dn.bv_val, 0, 0 );
|
||||
#endif
|
||||
|
||||
slap_get_csn( op, csnbuf, sizeof(csnbuf), &csn, 1 );
|
||||
|
||||
if( 0 ) {
|
||||
retry: /* transaction retry */
|
||||
if( e != NULL ) {
|
||||
|
|
@ -579,6 +585,19 @@ retry: /* transaction retry */
|
|||
}
|
||||
|
||||
if ( rs->sr_err == LDAP_SUCCESS && !op->o_no_psearch ) {
|
||||
Attribute *a;
|
||||
a = attr_find( e->e_attrs, slap_schema.si_ad_entryCSN );
|
||||
if ( a ) {
|
||||
if( (void *) e->e_attrs != (void *) (e+1)) {
|
||||
attr_delete( &e->e_attrs, slap_schema.si_ad_entryCSN );
|
||||
attr_merge_normalize_one( e, slap_schema.si_ad_entryCSN,
|
||||
&csn, NULL );
|
||||
} else {
|
||||
a->a_vals[0] = csn;
|
||||
}
|
||||
} else {
|
||||
/* Hm, the entryCSN ought to exist. ??? */
|
||||
}
|
||||
ldap_pvt_thread_rdwr_wlock( &bdb->bi_pslist_rwlock );
|
||||
LDAP_LIST_FOREACH( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
|
||||
rc = bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_DELETE );
|
||||
|
|
|
|||
Loading…
Reference in a new issue