]> git.sur5r.net Git - openldap/commitdiff
Add txn_checkpoint()'ing
authorKurt Zeilenga <kurt@openldap.org>
Thu, 28 Sep 2000 04:09:13 +0000 (04:09 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 28 Sep 2000 04:09:13 +0000 (04:09 +0000)
disable moddn/newSuperior (needs re'IDing)

servers/slapd/back-bdb/add.c
servers/slapd/back-bdb/back-bdb.h
servers/slapd/back-bdb/config.c
servers/slapd/back-bdb/delete.c
servers/slapd/back-bdb/modify.c
servers/slapd/back-bdb/modrdn.c
servers/slapd/back-bdb/passwd.c

index 03aba133d72f33ca37a86cc6e7d78661068e72ce..346c032f10b9906fd7495470359da5c2f2ff94ca 100644 (file)
@@ -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 */
index dee9b15684b3d1089d2436696788e3f6911cc3a7..1a80525c2c5807eac99e7951127a9e1799ddc4a6 100644 (file)
@@ -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]
index b1bf856a971b6b45449be221b9d1149bf0bb4db9..f56b8cc2a8a55a79ad9efd480fc94026a4f03a48 100644 (file)
@@ -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 ) {
index b06910738459ba183431c54e71930615683fdd11..8ad2557473e2af42b75a86c0f22ca8b1a6fd0b69 100644 (file)
@@ -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 ) {
index 100fb8ebb4d7bf4b163604492ba38207046cfd20..6fcba55305da604b6a4cb5b4da90fca78618f8c0 100644 (file)
@@ -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 );
index 085bed9ac9392bb671afcc8881bb4bcb98608d44..3be0b2b2218f08cdd85587e40c073dbc4b781766 100644 (file)
@@ -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 );
index fa993077c87ae37a51ae6adeee85ac248a343ec9..cb6ca711f6643c2ce9f38be24200c91d9598d4c9 100644 (file)
@@ -192,7 +192,6 @@ retry:      /* transaction retry */
                }
                *text = "entry update failed";
                rc = LDAP_OTHER;
-               goto done;
        }
 
 done: