mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-25 09:09:54 -05:00
ITS#4720 release csn mutex before checkpointing.
This commit is contained in:
parent
5c236d9df5
commit
b009b1820e
1 changed files with 10 additions and 9 deletions
|
|
@ -1260,9 +1260,9 @@ syncprov_op_cleanup( Operation *op, SlapReply *rs )
|
|||
}
|
||||
|
||||
static void
|
||||
syncprov_checkpoint( Operation *op, SlapReply *rs, slap_overinst *on )
|
||||
syncprov_checkpoint( Operation *op, SlapReply *rs, slap_overinst *on,
|
||||
struct berval *csn )
|
||||
{
|
||||
syncprov_info_t *si = on->on_bi.bi_private;
|
||||
Modifications mod;
|
||||
Operation opm;
|
||||
SlapReply rsm = { 0 };
|
||||
|
|
@ -1270,12 +1270,12 @@ syncprov_checkpoint( Operation *op, SlapReply *rs, slap_overinst *on )
|
|||
slap_callback cb = {0};
|
||||
|
||||
/* If ctxcsn is empty, delete it */
|
||||
if ( BER_BVISEMPTY( &si->si_ctxcsn )) {
|
||||
if ( BER_BVISEMPTY( csn )) {
|
||||
mod.sml_values = NULL;
|
||||
} else {
|
||||
mod.sml_values = bv;
|
||||
bv[1].bv_val = NULL;
|
||||
bv[0] = si->si_ctxcsn;
|
||||
bv[0] = *csn;
|
||||
}
|
||||
mod.sml_nvalues = NULL;
|
||||
mod.sml_desc = slap_schema.si_ad_contextCSN;
|
||||
|
|
@ -1510,6 +1510,7 @@ syncprov_op_response( Operation *op, SlapReply *rs )
|
|||
{
|
||||
struct berval maxcsn = BER_BVNULL;
|
||||
char cbuf[LDAP_LUTIL_CSNSTR_BUFSIZE];
|
||||
int do_check = 0;
|
||||
|
||||
/* Update our context CSN */
|
||||
cbuf[0] = '\0';
|
||||
|
|
@ -1532,7 +1533,6 @@ syncprov_op_response( Operation *op, SlapReply *rs )
|
|||
|
||||
si->si_numops++;
|
||||
if ( si->si_chkops || si->si_chktime ) {
|
||||
int do_check=0;
|
||||
if ( si->si_chkops && si->si_numops >= si->si_chkops ) {
|
||||
do_check = 1;
|
||||
si->si_numops = 0;
|
||||
|
|
@ -1542,15 +1542,16 @@ syncprov_op_response( Operation *op, SlapReply *rs )
|
|||
do_check = 1;
|
||||
si->si_chklast = op->o_time;
|
||||
}
|
||||
if ( do_check ) {
|
||||
syncprov_checkpoint( op, rs, on );
|
||||
}
|
||||
}
|
||||
ldap_pvt_thread_mutex_unlock( &si->si_csn_mutex );
|
||||
|
||||
opc->sctxcsn.bv_len = maxcsn.bv_len;
|
||||
opc->sctxcsn.bv_val = cbuf;
|
||||
|
||||
if ( do_check ) {
|
||||
syncprov_checkpoint( op, rs, on, &opc->sctxcsn );
|
||||
}
|
||||
|
||||
/* Handle any persistent searches */
|
||||
if ( si->si_ops ) {
|
||||
switch(op->o_tag) {
|
||||
|
|
@ -2472,7 +2473,7 @@ syncprov_db_close(
|
|||
op->o_bd = be;
|
||||
op->o_dn = be->be_rootdn;
|
||||
op->o_ndn = be->be_rootndn;
|
||||
syncprov_checkpoint( op, &rs, on );
|
||||
syncprov_checkpoint( op, &rs, on, &si->si_ctxcsn );
|
||||
ldap_pvt_thread_pool_context_reset( thrctx );
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue