Commit 7af81733 authored by Quanah Gibson-Mount's avatar Quanah Gibson-Mount
Browse files

ITS#6001

parent a56a2b7f
...@@ -8,6 +8,7 @@ OpenLDAP 2.4.16 Engineering ...@@ -8,6 +8,7 @@ OpenLDAP 2.4.16 Engineering
Fixed libldap peer cert double free (ITS#5849) Fixed libldap peer cert double free (ITS#5849)
Fixed libldap referral chasing (ITS#5980) Fixed libldap referral chasing (ITS#5980)
Fixed slapd backglue with empty DBs (ITS#5986) Fixed slapd backglue with empty DBs (ITS#5986)
Fixed slapd ctxcsn race condition (ITS#6001)
Fixed slapd syncrepl newCookie sync messages (ITS#5972) Fixed slapd syncrepl newCookie sync messages (ITS#5972)
Fixed slapd syncrepl multiple CSN propagation (ITS#5973) Fixed slapd syncrepl multiple CSN propagation (ITS#5973)
Fixed slapd-bdb/hdb cachesize handling (ITS#5860) Fixed slapd-bdb/hdb cachesize handling (ITS#5860)
......
...@@ -40,6 +40,7 @@ slap_get_commit_csn( ...@@ -40,6 +40,7 @@ slap_get_commit_csn(
{ {
struct slap_csn_entry *csne, *committed_csne = NULL; struct slap_csn_entry *csne, *committed_csne = NULL;
BackendDB *be = op->o_bd->bd_self; BackendDB *be = op->o_bd->bd_self;
int sid = -1;
if ( maxcsn ) { if ( maxcsn ) {
assert( maxcsn->bv_val != NULL ); assert( maxcsn->bv_val != NULL );
...@@ -51,6 +52,10 @@ slap_get_commit_csn( ...@@ -51,6 +52,10 @@ slap_get_commit_csn(
ldap_pvt_thread_mutex_lock( &be->be_pcl_mutex ); ldap_pvt_thread_mutex_lock( &be->be_pcl_mutex );
if ( !BER_BVISEMPTY( &op->o_csn )) {
sid = slap_parse_csn_sid( &op->o_csn );
}
LDAP_TAILQ_FOREACH( csne, be->be_pending_csn_list, ce_csn_link ) { LDAP_TAILQ_FOREACH( csne, be->be_pending_csn_list, ce_csn_link ) {
if ( csne->ce_opid == op->o_opid && csne->ce_connid == op->o_connid ) { if ( csne->ce_opid == op->o_opid && csne->ce_connid == op->o_connid ) {
csne->ce_state = SLAP_CSN_COMMIT; csne->ce_state = SLAP_CSN_COMMIT;
...@@ -60,8 +65,10 @@ slap_get_commit_csn( ...@@ -60,8 +65,10 @@ slap_get_commit_csn(
} }
LDAP_TAILQ_FOREACH( csne, be->be_pending_csn_list, ce_csn_link ) { LDAP_TAILQ_FOREACH( csne, be->be_pending_csn_list, ce_csn_link ) {
if ( csne->ce_state == SLAP_CSN_COMMIT ) committed_csne = csne; if ( sid != -1 && sid == csne->ce_sid ) {
if ( csne->ce_state == SLAP_CSN_PENDING ) break; if ( csne->ce_state == SLAP_CSN_COMMIT ) committed_csne = csne;
if ( csne->ce_state == SLAP_CSN_PENDING ) break;
}
} }
if ( maxcsn ) { if ( maxcsn ) {
...@@ -185,6 +192,7 @@ slap_queue_csn( ...@@ -185,6 +192,7 @@ slap_queue_csn(
ber_dupbv( &pending->ce_csn, csn ); ber_dupbv( &pending->ce_csn, csn );
ber_bvreplace_x( &op->o_csn, &pending->ce_csn, op->o_tmpmemctx ); ber_bvreplace_x( &op->o_csn, &pending->ce_csn, op->o_tmpmemctx );
pending->ce_sid = slap_parse_csn_sid( csn );
pending->ce_connid = op->o_connid; pending->ce_connid = op->o_connid;
pending->ce_opid = op->o_opid; pending->ce_opid = op->o_opid;
pending->ce_state = SLAP_CSN_PENDING; pending->ce_state = SLAP_CSN_PENDING;
......
...@@ -2371,6 +2371,7 @@ typedef struct PagedResultsState { ...@@ -2371,6 +2371,7 @@ typedef struct PagedResultsState {
struct slap_csn_entry { struct slap_csn_entry {
struct berval ce_csn; struct berval ce_csn;
int ce_sid;
unsigned long ce_opid; unsigned long ce_opid;
unsigned long ce_connid; unsigned long ce_connid;
#define SLAP_CSN_PENDING 1 #define SLAP_CSN_PENDING 1
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment