]> code.citadel.org Git - citadel.git/commitdiff
* database_sleepycat.c: when running txn_checkpoint(), handle DB_INCOMPLETE
authorArt Cancro <ajc@citadel.org>
Fri, 3 Aug 2001 16:43:54 +0000 (16:43 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 3 Aug 2001 16:43:54 +0000 (16:43 +0000)
  return code as a warning instead of an error worthy of aborting the server.
  See http://www.sleepycat.com/docs/api_c/txn_checkpoint.html for explanation.

citadel/ChangeLog
citadel/database_sleepycat.c

index 03ed596f47d55fcc64e08c301c27261dee6b04bc..95721353f169687bf41820a9cddca5ec3927e2ba 100644 (file)
@@ -1,4 +1,9 @@
  $Log$
+ Revision 580.17  2001/08/03 16:43:53  ajc
+ * database_sleepycat.c: when running txn_checkpoint(), handle DB_INCOMPLETE
+   return code as a warning instead of an error worthy of aborting the server.
+   See http://www.sleepycat.com/docs/api_c/txn_checkpoint.html for explanation.
+
  Revision 580.16  2001/07/30 03:46:14  nbryant
  made ForEachUser use a read-only cursor, too. there is now only one piece of
  code in Citadel proper (not the database driver) that needs transactions.
@@ -2647,3 +2652,4 @@ 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 8579e733228bff894402e5aa60040b7b02caec41..9bbc86b924ed9e0f80bd70c5712af1b917e0322f 100644 (file)
@@ -13,7 +13,7 @@
  * 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_KBYTES  256
 #define MAX_CHECKPOINT_MINUTES 15
 
 /*****************************************************************************/
@@ -211,11 +211,14 @@ static void cdb_checkpoint(void) {
                                MAX_CHECKPOINT_KBYTES,
                                MAX_CHECKPOINT_MINUTES,
                                0);
-       if (ret) {
+       if ( (ret != 0) && (ret != DB_INCOMPLETE) ) {
                lprintf(1, "cdb_checkpoint: txn_checkpoint: %s\n", db_strerror(ret));
                abort();
        }
 
+       if (ret == DB_INCOMPLETE) {
+               lprintf(3, "WARNING: txn_checkpoint: %s\n", db_strerror(ret));
+       }
 
        /* Cull the logs if we haven't done so for 24 hours */
        if ((time(NULL) - last_cull) > 86400L) {