From 176e3826b1605a732a01530a7399e2513b2213c1 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 12 Dec 2000 18:06:46 +0000 Subject: [PATCH] * Removed the transaction stuff (but left the log in). It wasn't working. --- citadel/ChangeLog | 5 +++ citadel/citserver.c | 2 -- citadel/database.c | 11 ------- citadel/database_sleepycat.c | 59 ++---------------------------------- citadel/sysdep.c | 2 -- 5 files changed, 8 insertions(+), 71 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index b2d123ab7..5caccd5a4 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -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 Fri Jul 10 1998 Art Cancro * Initial CVS import + + diff --git a/citadel/citserver.c b/citadel/citserver.c index 24f106b46..c4bcd50e5 100644 --- a/citadel/citserver.c +++ b/citadel/citserver.c @@ -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 */ diff --git a/citadel/database.c b/citadel/database.c index ae16edc64..c9bd3988a 100644 --- a/citadel/database.c +++ b/citadel/database.c @@ -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) { -} diff --git a/citadel/database_sleepycat.c b/citadel/database_sleepycat.c index cb31b8dd3..fd0f2f6c5 100644 --- a/citadel/database_sleepycat.c +++ b/citadel/database_sleepycat.c @@ -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); -} diff --git a/citadel/sysdep.c b/citadel/sysdep.c index 2b6cb6800..455faf759 100644 --- a/citadel/sysdep.c +++ b/citadel/sysdep.c @@ -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); -- 2.30.2