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 */
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]
}
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 ) {
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 ) {
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 );
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 );
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 );
}
*text = "entry update failed";
rc = LDAP_OTHER;
- goto done;
}
done: