From: Art Cancro Date: Mon, 23 May 2005 19:33:57 +0000 (+0000) Subject: * database_sleepycat.c: cdb_truncate() no longer encapsulated in a X-Git-Tag: v7.86~4885 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=f0f639e1b8e8783269856184a56f7f9e10f26e21;p=citadel.git * database_sleepycat.c: cdb_truncate() no longer encapsulated in a transaction. Truncating a database in Citadel is always synchronous, and with big tables (such as when the full text indexer is switched off or reinitialized) it was running out of memory. --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index f28fbb9a6..7d417c34f 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,7 +1,3 @@ - $Log$ - Revision 647.21 2005/05/23 19:31:52 ajc - * test - Revision 647.20 2005/05/23 19:26:04 ajc * Move the location of the "enable full text index" configuration item to a new location. Reusing an old location was a stupid idea because old diff --git a/citadel/database_sleepycat.c b/citadel/database_sleepycat.c index 1ce1e1b2b..1e2b4f6ce 100644 --- a/citadel/database_sleepycat.c +++ b/citadel/database_sleepycat.c @@ -873,7 +873,7 @@ void cdb_end_transaction(void) */ void cdb_trunc(int cdb) { - //DB_TXN *tid; + /* DB_TXN *tid; */ int ret; u_int32_t count; @@ -886,14 +886,14 @@ void cdb_trunc(int cdb) "attempt to write during r/o cursor"); retry: - //txbegin(&tid); + /* txbegin(&tid); */ if ((ret = dbp[cdb]->truncate(dbp[cdb], /* db */ NULL, /* transaction ID */ &count, /* #rows deleted */ 0))) { /* flags */ if (ret == DB_LOCK_DEADLOCK) { - //txabort(tid); + /* txabort(tid); */ goto retry; } else { lprintf(CTDL_EMERG, @@ -902,7 +902,7 @@ void cdb_trunc(int cdb) abort(); } } else { - //txcommit(tid); + /* txcommit(tid); */ } } }