mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-01 04:29:35 -05:00
Add link to FAQ entry on BDB tuning
This commit is contained in:
parent
b623699a44
commit
5487575086
11 changed files with 56 additions and 14 deletions
|
|
@ -7,6 +7,8 @@
|
|||
#
|
||||
# Hints can also be found in the OpenLDAP Software FAQ
|
||||
# <http://www.openldap.org/faq/index.cgi?file=2>
|
||||
# in particular:
|
||||
# <http://www.openldap.org/faq/index.cgi?file=1075>
|
||||
|
||||
# one 0.25 GB cache
|
||||
set_cachesize 0 268435456 1
|
||||
|
|
|
|||
|
|
@ -180,6 +180,13 @@ do_add( Operation *op, SlapReply *rs )
|
|||
|
||||
op->o_bd = frontendDB;
|
||||
rc = frontendDB->be_add( op, rs );
|
||||
|
||||
#ifdef LDAP_X_TXN
|
||||
if ( rc == LDAP_X_TXN_SPECIFY_OKAY ) {
|
||||
/* skip cleanup */
|
||||
return rc;
|
||||
} else
|
||||
#endif
|
||||
if ( rc == 0 ) {
|
||||
if ( op->ora_e != NULL && op->o_private != NULL ) {
|
||||
BackendDB *bd = op->o_bd;
|
||||
|
|
@ -281,8 +288,7 @@ fe_op_add( Operation *op, SlapReply *rs )
|
|||
if ( op->o_bd->be_add ) {
|
||||
/* do the update here */
|
||||
int repl_user = be_isupdate( op );
|
||||
if ( !SLAP_SINGLE_SHADOW(op->o_bd) || repl_user )
|
||||
{
|
||||
if ( !SLAP_SINGLE_SHADOW(op->o_bd) || repl_user ) {
|
||||
int update = !BER_BVISEMPTY( &op->o_bd->be_update_ndn );
|
||||
slap_callback cb = { NULL, slap_replog_cb, NULL, NULL };
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ bdb_add(Operation *op, SlapReply *rs )
|
|||
/* insert operation into transaction */
|
||||
|
||||
rs->sr_text = "transaction specified";
|
||||
rs->sr_err = LDAP_SUCCESS;
|
||||
rs->sr_err = LDAP_X_TXN_SPECIFY_OKAY;
|
||||
|
||||
txnReturn:
|
||||
/* release connection lock */
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ bdb_delete( Operation *op, SlapReply *rs )
|
|||
/* insert operation into transaction */
|
||||
|
||||
rs->sr_text = "transaction specified";
|
||||
rs->sr_err = LDAP_SUCCESS;
|
||||
rs->sr_err = LDAP_X_TXN_SPECIFY_OKAY;
|
||||
|
||||
txnReturn:
|
||||
/* release connection lock */
|
||||
|
|
|
|||
|
|
@ -325,7 +325,7 @@ bdb_modify( Operation *op, SlapReply *rs )
|
|||
/* insert operation into transaction */
|
||||
|
||||
rs->sr_text = "transaction specified";
|
||||
rs->sr_err = LDAP_SUCCESS;
|
||||
rs->sr_err = LDAP_X_TXN_SPECIFY_OKAY;
|
||||
|
||||
txnReturn:
|
||||
/* release connection lock */
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ bdb_modrdn( Operation *op, SlapReply *rs )
|
|||
/* insert operation into transaction */
|
||||
|
||||
rs->sr_text = "transaction specified";
|
||||
rs->sr_err = LDAP_SUCCESS;
|
||||
rs->sr_err = LDAP_X_TXN_SPECIFY_OKAY;
|
||||
|
||||
txnReturn:
|
||||
/* release connection lock */
|
||||
|
|
|
|||
|
|
@ -1268,6 +1268,20 @@ connection_operation( void *ctx, void *arg_v )
|
|||
goto operations_error;
|
||||
}
|
||||
|
||||
#ifdef LDAP_X_TXN
|
||||
if (( conn->c_txn == CONN_TXN_SPECIFY ) && (
|
||||
( tag == LDAP_REQ_ADD ) ||
|
||||
( tag == LDAP_REQ_DELETE ) ||
|
||||
( tag == LDAP_REQ_MODIFY ) ||
|
||||
( tag == LDAP_REQ_MODRDN )))
|
||||
{
|
||||
/* Disable SLAB allocator for all update operations
|
||||
issued inside of a transaction */
|
||||
op->o_tmpmemctx = NULL;
|
||||
op->o_tmpmfuncs = &ch_mfuncs;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
/* We can use Thread-Local storage for most mallocs. We can
|
||||
* also use TL for ber parsing, but not on Add or Modify.
|
||||
*/
|
||||
|
|
@ -1287,6 +1301,7 @@ connection_operation( void *ctx, void *arg_v )
|
|||
*/
|
||||
ber_set_option( op->o_ber, LBER_OPT_BER_MEMCTX, &memctx );
|
||||
}
|
||||
}
|
||||
|
||||
switch ( tag ) {
|
||||
case LDAP_REQ_BIND:
|
||||
|
|
|
|||
|
|
@ -90,6 +90,13 @@ do_delete(
|
|||
op->o_bd = frontendDB;
|
||||
rs->sr_err = frontendDB->be_delete( op, rs );
|
||||
|
||||
#ifdef LDAP_X_TXN
|
||||
if( rs->sr_err == LDAP_X_TXN_SPECIFY_OKAY ) {
|
||||
/* skip cleanup */
|
||||
return rs->sr_err;
|
||||
}
|
||||
#endif
|
||||
|
||||
cleanup:;
|
||||
op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx );
|
||||
op->o_tmpfree( op->o_req_ndn.bv_val, op->o_tmpmemctx );
|
||||
|
|
@ -155,8 +162,7 @@ fe_op_delete( Operation *op, SlapReply *rs )
|
|||
if ( op->o_bd->be_delete ) {
|
||||
/* do the update here */
|
||||
int repl_user = be_isupdate( op );
|
||||
if ( !SLAP_SINGLE_SHADOW(op->o_bd) || repl_user )
|
||||
{
|
||||
if ( !SLAP_SINGLE_SHADOW(op->o_bd) || repl_user ) {
|
||||
struct berval org_req_dn = BER_BVNULL;
|
||||
struct berval org_req_ndn = BER_BVNULL;
|
||||
struct berval org_dn = BER_BVNULL;
|
||||
|
|
@ -166,8 +172,7 @@ fe_op_delete( Operation *op, SlapReply *rs )
|
|||
|
||||
op->o_bd = op_be;
|
||||
|
||||
if ( !op->o_bd->be_update_ndn.bv_len || !repl_user )
|
||||
{
|
||||
if ( !op->o_bd->be_update_ndn.bv_len || !repl_user ) {
|
||||
cb.sc_next = op->o_callback;
|
||||
op->o_callback = &cb;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -198,6 +198,13 @@ do_modify(
|
|||
op->o_bd = frontendDB;
|
||||
rs->sr_err = frontendDB->be_modify( op, rs );
|
||||
|
||||
#ifdef LDAP_X_TXN
|
||||
if( rs->sr_err == LDAP_X_TXN_SPECIFY_OKAY ) {
|
||||
/* skip cleanup */
|
||||
return rs->sr_err;
|
||||
}
|
||||
#endif
|
||||
|
||||
cleanup:
|
||||
op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx );
|
||||
op->o_tmpfree( op->o_req_ndn.bv_val, op->o_tmpmemctx );
|
||||
|
|
|
|||
|
|
@ -184,6 +184,12 @@ do_modrdn(
|
|||
op->o_bd = frontendDB;
|
||||
rs->sr_err = frontendDB->be_modrdn( op, rs );
|
||||
|
||||
#ifdef LDAP_X_TXN
|
||||
if( rs->sr_err == LDAP_X_TXN_SPECIFY_OKAY ) {
|
||||
/* skip cleanup */
|
||||
}
|
||||
#endif
|
||||
|
||||
cleanup:
|
||||
op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx );
|
||||
op->o_tmpfree( op->o_req_ndn.bv_val, op->o_tmpmemctx );
|
||||
|
|
@ -194,10 +200,12 @@ cleanup:
|
|||
if ( op->orr_modlist != NULL )
|
||||
slap_mods_free( op->orr_modlist, 1 );
|
||||
|
||||
if ( !BER_BVISNULL( &pnewSuperior ) )
|
||||
if ( !BER_BVISNULL( &pnewSuperior ) ) {
|
||||
op->o_tmpfree( pnewSuperior.bv_val, op->o_tmpmemctx );
|
||||
if ( !BER_BVISNULL( &nnewSuperior ) )
|
||||
}
|
||||
if ( !BER_BVISNULL( &nnewSuperior ) ) {
|
||||
op->o_tmpfree( nnewSuperior.bv_val, op->o_tmpmemctx );
|
||||
}
|
||||
|
||||
return rs->sr_err;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,8 +132,7 @@ slap_op_alloc(
|
|||
BerElement *ber,
|
||||
ber_int_t msgid,
|
||||
ber_tag_t tag,
|
||||
ber_int_t id
|
||||
)
|
||||
ber_int_t id )
|
||||
{
|
||||
Operation *op;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue