* Removed the transaction stuff (but left the log in). It wasn't working.
authorArt Cancro <ajc@citadel.org>
Tue, 12 Dec 2000 18:06:46 +0000 (18:06 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 12 Dec 2000 18:06:46 +0000 (18:06 +0000)
citadel/ChangeLog
citadel/citserver.c
citadel/database.c
citadel/database_sleepycat.c
citadel/sysdep.c

index b2d123ab79295f5e8502b61eb8be507c68d774ef..5caccd5a47d9a3a81e0e129187f8d9d57a50b7b1 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 573.50  2000/12/12 18:06:46  ajc
+ * Removed the transaction stuff (but left the log in).  It wasn't working.
+
  Revision 573.49  2000/12/12 06:19:55  ajc
  * Stabilize, dammit!!
 
@@ -2220,3 +2223,5 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
 
+
+
index 24f106b4607deb4d57c8dc2fa715d8c9f2202416..c4bcd50e5f56bbdc0207de66753d6299af858d98 100644 (file)
@@ -57,7 +57,6 @@ void master_startup(void) {
        lprintf(9, "master_startup() started\n");
        lprintf(7, "Opening databases\n");
        open_databases();
-       cdb_begin_transaction();
 
        if (do_defrag) {
                defrag_databases();
@@ -100,7 +99,6 @@ void master_cleanup(void) {
 
        /* Close databases */
        lprintf(7, "Closing databases\n");
-       cdb_end_transaction();
        close_databases();
 
        /* Do system-dependent stuff */
index ae16edc64e3230c130e743ae9d43e26db4651aa3..c9bd3988a41baf0bfb885dbe101040c1c5e3a142 100644 (file)
@@ -338,14 +338,3 @@ struct cdbdata *cdb_next_item(int cdb)
        return (cdbret);
 }
 
-
-
-/*
- * GDBM doesn't support transaction-based logging.  Stub out these functions.
- */
-
-void cdb_begin_transaction(void) {
-}
-
-void cdb_end_transaction(void) {
-}
index cb31b8dd3191c7a5722d4e47d88aea053526d9a0..fd0f2f6c5fc56fb99f4e059009346742e7f6afc3 100644 (file)
@@ -5,17 +5,6 @@
  *
  */
 
-/*****************************************************************************
-       Tunable configuration parameters for the Sleepycat DB back end
- *****************************************************************************/
-
-/* Citadel will checkpoint the db at the end of every session, but only if
- * the specified number of kilobytes has been written, or if the specified
- * number of minutes has passed, since the last checkpoint.
- */
-#define MAX_CHECKPOINT_KBYTES  0
-#define MAX_CHECKPOINT_MINUTES 15
-
 /*****************************************************************************/
 
 #include "sysdep.h"
@@ -38,7 +27,6 @@
 
 DB *dbp[MAXCDB];               /* One DB handle for each Citadel database */
 DB_ENV *dbenv;                 /* The DB environment (global) */
-DB_TXN *MYTID;
 
 struct cdbssd {                        /* Session-specific DB stuff */
        DBC *cursor;            /* Cursor, for traversals... */
@@ -48,11 +36,12 @@ struct cdbssd *ssd_arr = NULL;
 int num_ssd = 0;
 
 #define MYCURSOR       ssd_arr[CC->cs_pid].cursor
+#define MYTID          NULL
 
 /*
  * Ensure that we have enough space for session-specific data.  We don't
  * put anything in here that Citadel cares about; this is just database
- * related stuff like cursors and transactions.
+ * related stuff like cursors.
  */
 void cdb_allocate_ssd(void) {
        /*
@@ -88,22 +77,6 @@ void defrag_databases(void)
 
 
 
-/*
- * Request a checkpoint of the database.
- */
-void cdb_checkpoint(void) {
-       int ret;
-
-       ret = txn_checkpoint(dbenv,
-                               MAX_CHECKPOINT_KBYTES,
-                               MAX_CHECKPOINT_MINUTES,
-                               0);
-       if (ret) {
-               lprintf(1, "txn_checkpoint: %s\n", db_strerror(ret));
-       }
-}
-
-
 /*
  * Open the various databases we'll be using.  Any database which
  * does not exist should be created.  Note that we don't need an S_DATABASE
@@ -150,7 +123,7 @@ void open_databases(void)
         * is serialized already, so don't bother the database manager with
         * it.  Besides, it locks up when we do it that way.
          */
-        flags = DB_CREATE|DB_RECOVER|DB_INIT_MPOOL|DB_PRIVATE|DB_INIT_TXN;
+        flags = DB_CREATE|DB_RECOVER|DB_INIT_MPOOL|DB_PRIVATE|DB_INIT_LOG;
        /* flags |= DB_INIT_LOCK | DB_THREAD; */
         ret = dbenv->open(dbenv, "./data", flags, 0);
        if (ret) {
@@ -190,7 +163,6 @@ void open_databases(void)
 
        cdb_allocate_ssd();
        CtdlRegisterSessionHook(cdb_allocate_ssd, EVT_START);
-       CtdlRegisterSessionHook(cdb_checkpoint, EVT_TIMER);
        lprintf(9, "open_databases() finished\n");
 }
 
@@ -380,28 +352,3 @@ struct cdbdata *cdb_next_item(int cdb)
        return (cdbret);
 }
 
-
-/*
- * Transaction-based stuff.  I'm writing this as I bake cookies...
- */
-
-void cdb_begin_transaction(void) {
-
-       begin_critical_section(S_DATABASE);
-
-       if (MYTID != NULL) {    /* FIXME this slows it down, take it out */
-               lprintf(1, "ERROR: thread %d is opening a new transaction with one already open!\n", getpid());
-       }
-       else {
-               txn_begin(dbenv, NULL, &MYTID, 0);
-       }
-       end_critical_section(S_DATABASE);
-}
-
-void cdb_end_transaction(void) {
-       begin_critical_section(S_DATABASE);
-       if (MYTID == NULL) lprintf(1, "ERROR: txn_commit(NULL) !!\n");
-       else txn_commit(MYTID, 0);
-       MYTID = NULL;   /* FIXME take out */
-       end_critical_section(S_DATABASE);
-}
index 2b6cb68009ed39650390e8c93a8ef56323875fe6..455faf75935c306704df1e3fe47df19f727bdcb8 100644 (file)
@@ -1060,8 +1060,6 @@ void worker_thread(void) {
                 */
 
                begin_critical_section(S_I_WANNA_SELECT);
-               cdb_end_transaction();
-               cdb_begin_transaction();
 SETUP_FD:      memcpy(&readfds, &masterfds, sizeof masterfds);
                highest = masterhighest;
                begin_critical_section(S_SESSION_TABLE);