Move pre/post read calls into outer transaction.

Need to fix retry handling.
This commit is contained in:
Kurt Zeilenga 2004-06-23 06:02:49 +00:00
parent ec9d21e094
commit e23b0f677f
4 changed files with 58 additions and 53 deletions

View file

@ -344,23 +344,6 @@ retry: /* transaction retry */
goto return_results;;
}
/* post-read */
if( op->o_postread ) {
if ( slap_read_controls( op, rs, op->oq_add.rs_e,
&slap_post_read_bv, &ctrls[num_ctrls] ) )
{
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"<=- bdb_add: post-read failed!\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- bdb_add: post-read failed!\n", 0, 0, 0 );
#endif
goto return_results;
}
ctrls[++num_ctrls] = NULL;
}
/* nested transaction */
rs->sr_err = TXN_BEGIN( bdb->bi_dbenv, ltid, &lt2,
bdb->bi_db_opflags );
@ -462,6 +445,25 @@ retry: /* transaction retry */
}
}
/* post-read */
if( op->o_postread ) {
if ( slap_read_controls( op, rs, op->oq_add.rs_e,
&slap_post_read_bv, &ctrls[num_ctrls] ) )
{
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"<=- bdb_add: post-read failed!\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- bdb_add: post-read failed!\n", 0, 0, 0 );
#endif
goto return_results;
}
ctrls[++num_ctrls] = NULL;
op->o_postread = 0; /* prevent redo on retry */
/* FIXME: should read entry on the last retry */
}
if ( op->o_noop ) {
if (( rs->sr_err=TXN_ABORT( ltid )) != 0 ) {
rs->sr_text = "txn_abort (no-op) failed";

View file

@ -359,6 +359,8 @@ retry: /* transaction retry */
goto return_results;
}
ctrls[++num_ctrls] = NULL;
op->o_preread = 0; /* prevent redo on retry */
/* FIXME: should read entry on the last retry */
}
/* nested transaction */

View file

@ -597,24 +597,6 @@ retry: /* transaction retry */
goto return_results;
}
if( op->o_postread ) {
if( slap_read_controls( op, rs, e,
&slap_post_read_bv, &ctrls[num_ctrls] ) )
{
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"<=- bdb_modify: post-read failed!\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- bdb_modify: post-read failed!\n", 0, 0, 0 );
#endif
goto return_results;
}
ctrls[++num_ctrls] = NULL;
op->o_postread = 0; /* prevent redo on retry */
/* FIXME: should read entry on the last retry */
}
/* change the entry itself */
rs->sr_err = bdb_id2entry_update( op->o_bd, lt2, &dummy );
if ( rs->sr_err != 0 ) {
@ -652,6 +634,24 @@ retry: /* transaction retry */
}
}
if( op->o_postread ) {
if( slap_read_controls( op, rs, e,
&slap_post_read_bv, &ctrls[num_ctrls] ) )
{
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"<=- bdb_modify: post-read failed!\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- bdb_modify: post-read failed!\n", 0, 0, 0 );
#endif
goto return_results;
}
ctrls[++num_ctrls] = NULL;
op->o_postread = 0; /* prevent redo on retry */
/* FIXME: should read entry on the last retry */
}
if( op->o_noop ) {
if ( ( rs->sr_err = TXN_ABORT( ltid ) ) != 0 ) {
rs->sr_text = "txn_abort (no-op) failed";

View file

@ -803,6 +803,7 @@ retry: /* transaction retry */
}
ctrls[++num_ctrls] = NULL;
op->o_preread = 0; /* prevent redo on retry */
/* FIXME: should read entry on the last retry */
}
/* nested transaction */
@ -919,24 +920,6 @@ retry: /* transaction retry */
goto return_results;
}
if( op->o_postread ) {
if( slap_read_controls( op, rs, e,
&slap_post_read_bv, &ctrls[num_ctrls] ) )
{
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"<=- bdb_modrdn: post-read failed!\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- bdb_modrdn: post-read failed!\n", 0, 0, 0 );
#endif
goto return_results;
}
ctrls[++num_ctrls] = NULL;
op->o_postread = 0; /* prevent redo on retry */
/* FIXME: should read entry on the last retry */
}
/* id2entry index */
rs->sr_err = bdb_id2entry_update( op->o_bd, lt2, e );
if ( rs->sr_err != 0 ) {
@ -1008,6 +991,24 @@ retry: /* transaction retry */
}
}
if( op->o_postread ) {
if( slap_read_controls( op, rs, e,
&slap_post_read_bv, &ctrls[num_ctrls] ) )
{
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"<=- bdb_modrdn: post-read failed!\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- bdb_modrdn: post-read failed!\n", 0, 0, 0 );
#endif
goto return_results;
}
ctrls[++num_ctrls] = NULL;
op->o_postread = 0; /* prevent redo on retry */
/* FIXME: should read entry on the last retry */
}
if( op->o_noop ) {
if(( rs->sr_err=TXN_ABORT( ltid )) != 0 ) {
rs->sr_text = "txn_abort (no-op) failed";