mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
Add txn_checkpoint()'ing
disable moddn/newSuperior (needs re'IDing)
This commit is contained in:
parent
f106722ebf
commit
819b5303da
@ -275,6 +275,12 @@ return_results:
|
||||
send_ldap_result( conn, op, rc,
|
||||
NULL, text, NULL, NULL );
|
||||
|
||||
if(rc == LDAP_SUCCESS && bdb->bi_txn_cp ) {
|
||||
ldap_pvt_thread_yield();
|
||||
txn_checkpoint( bdb->bi_dbenv,
|
||||
bdb->bi_txn_cp_kbyte, bdb->bi_txn_cp_min, 0 );
|
||||
}
|
||||
|
||||
done:
|
||||
if (p != NULL) {
|
||||
/* free parent and writer lock */
|
||||
|
@ -69,6 +69,10 @@ struct bdb_info {
|
||||
|
||||
int bi_ndatabases;
|
||||
struct bdb_db_info **bi_databases;
|
||||
|
||||
int bi_txn_cp;
|
||||
u_int32_t bi_txn_cp_min;
|
||||
u_int32_t bi_txn_cp_kbyte;
|
||||
};
|
||||
#define bi_nextid bi_databases[BDB_NEXTID]
|
||||
#define bi_id2entry bi_databases[BDB_ID2ENTRY]
|
||||
|
@ -42,6 +42,19 @@ bdb_db_config(
|
||||
}
|
||||
bdb->bi_dbenv_home = ch_strdup( argv[1] );
|
||||
|
||||
|
||||
/* mode with which to create new database files */
|
||||
} else if ( strcasecmp( argv[0], "checkpoint" ) == 0 ) {
|
||||
if ( argc < 3 ) {
|
||||
fprintf( stderr, "%s: line %d: "
|
||||
"missing parameters in \"checkpoint <kbyte> <min>\" line\n",
|
||||
fname, lineno );
|
||||
return 1;
|
||||
}
|
||||
bdb->bi_txn_cp = 1;
|
||||
bdb->bi_txn_cp_kbyte = strtol( argv[1], NULL, 0 );
|
||||
bdb->bi_txn_cp_min = strtol( argv[2], NULL, 0 );
|
||||
|
||||
/* mode with which to create new database files */
|
||||
} else if ( strcasecmp( argv[0], "mode" ) == 0 ) {
|
||||
if ( argc < 2 ) {
|
||||
|
@ -269,6 +269,12 @@ return_results:
|
||||
send_ldap_result( conn, op, LDAP_SUCCESS,
|
||||
NULL, text, NULL, NULL );
|
||||
|
||||
if(rc == LDAP_SUCCESS && bdb->bi_txn_cp ) {
|
||||
ldap_pvt_thread_yield();
|
||||
txn_checkpoint( bdb->bi_dbenv,
|
||||
bdb->bi_txn_cp_kbyte, bdb->bi_txn_cp_min, 0 );
|
||||
}
|
||||
|
||||
done:
|
||||
/* free entry */
|
||||
if( e != NULL ) {
|
||||
|
@ -307,6 +307,12 @@ return_results:
|
||||
send_ldap_result( conn, op, rc,
|
||||
NULL, text, NULL, NULL );
|
||||
|
||||
if(rc == LDAP_SUCCESS && bdb->bi_txn_cp ) {
|
||||
ldap_pvt_thread_yield();
|
||||
txn_checkpoint( bdb->bi_dbenv,
|
||||
bdb->bi_txn_cp_kbyte, bdb->bi_txn_cp_min, 0 );
|
||||
}
|
||||
|
||||
done:
|
||||
if( ltid != NULL ) {
|
||||
txn_abort( ltid );
|
||||
|
@ -60,6 +60,12 @@ bdb_modrdn(
|
||||
Debug( LDAP_DEBUG_TRACE, "==>bdb_modrdn(%s,%s,%s)\n",
|
||||
dn, newrdn, (newSuperior ? newSuperior : "NULL") );
|
||||
|
||||
if( newSuperior != NULL ) {
|
||||
rc = LDAP_UNWILLING_TO_PERFORM;
|
||||
text = "newSuperior not implemented (yet)";
|
||||
goto return_results;
|
||||
}
|
||||
|
||||
if (0) {
|
||||
/* transaction retry */
|
||||
retry: rc = txn_abort( ltid );
|
||||
@ -515,6 +521,12 @@ return_results:
|
||||
send_ldap_result( conn, op, rc,
|
||||
NULL, text, NULL, NULL );
|
||||
|
||||
if(rc == LDAP_SUCCESS && bdb->bi_txn_cp ) {
|
||||
ldap_pvt_thread_yield();
|
||||
txn_checkpoint( bdb->bi_dbenv,
|
||||
bdb->bi_txn_cp_kbyte, bdb->bi_txn_cp_min, 0 );
|
||||
}
|
||||
|
||||
done:
|
||||
if( new_dn != NULL ) free( new_dn );
|
||||
if( new_ndn != NULL ) free( new_ndn );
|
||||
|
@ -192,7 +192,6 @@ retry: /* transaction retry */
|
||||
}
|
||||
*text = "entry update failed";
|
||||
rc = LDAP_OTHER;
|
||||
goto done;
|
||||
}
|
||||
|
||||
done:
|
||||
|
Loading…
Reference in New Issue
Block a user