* Automatic deletion of committed database logs is now a site-definable
authorArt Cancro <ajc@citadel.org>
Wed, 22 Jun 2005 03:03:34 +0000 (03:03 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 22 Jun 2005 03:03:34 +0000 (03:03 +0000)
  setting.

citadel/ChangeLog
citadel/citadel.h
citadel/config.h
citadel/control.c
citadel/database_sleepycat.c
citadel/routines2.c
citadel/serv_upgrade.c
citadel/serv_vandelay.c

index a94045b0704e9859e5a8c6d4a3db030bbc651464..a3dd79835a4313bc5246530a686d654f77a32d68 100644 (file)
@@ -1,4 +1,8 @@
 $Log$
+Revision 651.2  2005/06/22 03:03:34  ajc
+* Automatic deletion of committed database logs is now a site-definable
+  setting.
+
 Revision 651.1  2005/06/16 02:42:58  ajc
 * There is now a dedicated thread for doing database checkpoints.
 
@@ -6881,4 +6885,3 @@ 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 b0e72d6f9b6a09a09e2dc32f86c0a2a27285a1bb..32fc601d12b8f106eea5cbc07ef51a5437c0804d 100644 (file)
@@ -45,9 +45,9 @@ extern "C" {
  * usually more strict because you're not really supposed to dump/load and
  * upgrade at the same time.
  */
-#define REV_LEVEL      651             /* This version */
+#define REV_LEVEL      652             /* This version */
 #define REV_MIN                591             /* Oldest compatible database */
-#define EXPORT_REV_MIN 651             /* Oldest compatible export files */
+#define EXPORT_REV_MIN 652             /* Oldest compatible export files */
 
 #define SERVER_TYPE 0  /* zero for stock Citadel; other developers please
                           obtain SERVER_TYPE codes for your implementations */
index 160c5d96e8bac005a53e11de190c058d91f59254..09e0b8be99a028fbc9844efdc1bef6fc996be02a 100644 (file)
@@ -66,6 +66,7 @@ struct config {
        int c_imaps_port;               /* IMAPS listener port (usually 993)*/
        int c_pop3s_port;               /* POP3S listener port (usually 995)*/
        int c_smtps_port;               /* SMTPS listener port (usually 465)*/
+       char c_auto_cull;               /* Cull db logs automatically?      */
 };
 
 
index 93d8963c55defc6fc6007f4957eccfd4767d7157..0b882e85529ba1e8782dd83f4894e23e80b9fae9 100644 (file)
@@ -215,6 +215,7 @@ void cmd_conf(char *argbuf)
                cprintf("%d\n", config.c_pop3s_port);
                cprintf("%d\n", config.c_smtps_port);
                cprintf("%d\n", config.c_enable_fulltext);
+               cprintf("%d\n", config.c_auto_cull);
                cprintf("000\n");
        }
 
@@ -392,6 +393,9 @@ void cmd_conf(char *argbuf)
                        case 42:
                                config.c_enable_fulltext = atoi(buf);
                                break;
+                       case 43:
+                               config.c_auto_cull = atoi(buf);
+                               break;
                        }
                        ++a;
                }
index 1e4251bb726dd2dcc9e176dfdcab6e44858a932a..a108e1fe76c92b8f1e8c4288b049e06a345e64e4 100644 (file)
@@ -282,7 +282,9 @@ static void cdb_checkpoint(void)
        }
 
        /* After a successful checkpoint, we can cull the unused logs */
-       cdb_cull_logs();
+       if (config.c_auto_cull) {
+               cdb_cull_logs();
+       }
 }
 
 
index d5d375600f29e94b529076a25306d3428216c2cd..0248095359cb5037f04069b5b6a0354b9c0f84df 100644 (file)
@@ -644,7 +644,7 @@ void read_bio(CtdlIPC *ipc)
 void do_system_configuration(CtdlIPC *ipc)
 {
 
-#define NUM_CONFIGS 43
+#define NUM_CONFIGS 44
 
        char buf[SIZ];
        char sc[NUM_CONFIGS][256];
@@ -731,6 +731,9 @@ void do_system_configuration(CtdlIPC *ipc)
        strprompt("Maximum message length", &sc[20][0], 20);
        strprompt("Minimum number of worker threads", &sc[21][0], 3);
        strprompt("Maximum number of worker threads", &sc[22][0], 3);
+       snprintf(sc[43], sizeof sc[43], "%d", (boolprompt(
+               "Automatically delete committed database logs",
+               atoi(&sc[43][0]))));
 
        strprompt("Server IP address (0.0.0.0 for 'any')", &sc[37][0], 15);
        strprompt("POP3 server port (-1 to disable)", &sc[23][0], 5);
index 000e8afeabaf397f840005131283f4d0740973d1..e57951ac88c5c9aaedf2474de3e57ce1d3157d26 100644 (file)
@@ -176,6 +176,10 @@ void update_config(void) {
                config.c_enable_fulltext = 0;
        }
 
+       if (CitControl.version < 652) {
+               config.c_auto_cull = 1;
+       }
+
        put_config();
 }
 
index d5f9340ba883a25ea05e06e42dc72af1e42417ae..30c30a0ee4efad01a79d1a0af977044be15b5098 100644 (file)
@@ -309,6 +309,7 @@ void artv_do_export(void) {
        cprintf("%d\n", config.c_disable_newu);
        cprintf("%s\n", config.c_baseroom);
        cprintf("%s\n", config.c_aideroom);
+       cprintf("%d\n", config.c_auto_cull);
 
        /* Export the control file */
        get_control();
@@ -383,6 +384,7 @@ void artv_import_config(void) {
        client_getln(buf, sizeof buf);  config.c_disable_newu = atoi(buf);
        client_getln(config.c_baseroom, sizeof config.c_baseroom);
        client_getln(config.c_aideroom, sizeof config.c_aideroom);
+       client_getln(buf, sizeof buf);  config.c_auto_cull = atoi(buf);
        config.c_enable_fulltext = 0;   /* always disable */
        put_config();
        lprintf(CTDL_INFO, "Imported config file\n");