From e32aa64d19840a3b76da532d200fa1cb733e0672 Mon Sep 17 00:00:00 2001 From: ralf Date: Thu, 20 May 2010 15:08:28 +0000 Subject: Syncprov might lose deletes (ITS#6555) During the refresh phase the sync filter needs to be adjusted (skipping the "(entrycsn>=cookie)" part that was inserted) when checking whether a change needs to be replicated, otherwise we lose DELETES that happen during the refresh phase. bnc#606294 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index 675568e..030edf5 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -1301,7 +1301,15 @@ syncprov_matchops( Operation *op, opcookie *opc, int saveit ) op2.o_hdr = &oh; op2.o_extra = op->o_extra; op2.o_callback = NULL; - rc = test_filter( &op2, e, ss->s_op->ors_filter ); + ldap_pvt_thread_mutex_lock( &ss->s_mutex ); + if (ss->s_flags & PS_FIX_FILTER) { + /* Skip the AND/GE clause that we stuck on in front. We + would lose deletes/mods that happen during the refresh + phase otherwise (ITS#6555) */ + op2.ors_filter = ss->s_op->ors_filter->f_and->f_next; + } + ldap_pvt_thread_mutex_unlock( &ss->s_mutex ); + rc = test_filter( &op2, e, op2.ors_filter ); } Debug( LDAP_DEBUG_TRACE, "syncprov_matchops: sid %03x fscope %d rc %d\n", -- 1.7.0.3