Commit e23b0f67 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Move pre/post read calls into outer transaction.

Need to fix retry handling.
parent ec9d21e0
......@@ -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";
......
......@@ -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 */
......
......@@ -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";
......
......@@ -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";
......
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