gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r5160 - in GNUnet: . src/applications/sqstore_sqlite src/in


From: gnunet
Subject: [GNUnet-SVN] r5160 - in GNUnet: . src/applications/sqstore_sqlite src/include
Date: Thu, 28 Jun 2007 01:11:31 -0600 (MDT)

Author: grothoff
Date: 2007-06-28 01:11:31 -0600 (Thu, 28 Jun 2007)
New Revision: 5160

Modified:
   GNUnet/ChangeLog
   GNUnet/src/applications/sqstore_sqlite/sqlite.c
   GNUnet/src/applications/sqstore_sqlite/sqlitetest3.c
   GNUnet/src/include/gnunet_sqstore_service.h
Log:
fixing sqlite issues

Modified: GNUnet/ChangeLog
===================================================================
--- GNUnet/ChangeLog    2007-06-28 06:59:06 UTC (rev 5159)
+++ GNUnet/ChangeLog    2007-06-28 07:11:31 UTC (rev 5160)
@@ -1,3 +1,9 @@
+Thu Jun 28 01:10:01 MDT 2007
+       Fixed high-latency problems for certain SQLite operations.
+       Also improved SQLite performance (but not scalability) a
+       bit.  Resolved MySQL disconnect crash (gnunetd would crash
+       if mysqld was stopped).
+
 Sat Jun 23 16:56:03 MDT 2007
        Improved CPU consumption from content migration code
        by querying the DB less often, using the same content

Modified: GNUnet/src/applications/sqstore_sqlite/sqlite.c
===================================================================
--- GNUnet/src/applications/sqstore_sqlite/sqlite.c     2007-06-28 06:59:06 UTC 
(rev 5159)
+++ GNUnet/src/applications/sqstore_sqlite/sqlite.c     2007-06-28 07:11:31 UTC 
(rev 5160)
@@ -362,7 +362,12 @@
   Datastore_Value * value;
   int contentSize;
   sqlite3 * dbh;
+  unsigned int type;
 
+  type = sqlite3_column_int(stmt, 1);
+  if (type == RESERVED_BLOCK)
+    return NULL;
+
   contentSize = sqlite3_column_int(stmt, 0) - sizeof(Datastore_Value);
 
   dbh = handle->dbh;
@@ -371,7 +376,7 @@
 
     GE_LOG(ectx,
           GE_WARNING | GE_BULK | GE_USER,
-          _("Invalid data in %s.  Trying to fix (by deletion).\n"),
+          _("Invalid data in %s (NCS).  Trying to fix (by deletion).\n"),
           _("sqlite datastore"));
     if (sq_prepare(dbh,
                   "DELETE FROM gn070 WHERE size < ?", &stmt) == SQLITE_OK) {
@@ -416,7 +421,7 @@
   datum = MALLOC(sizeof(Datastore_Datum) + contentSize);
   value = &datum->value;
   value->size = htonl(contentSize + sizeof(Datastore_Value));
-  value->type = htonl(sqlite3_column_int(stmt, 1));
+  value->type = htonl(type);
   value->prio = htonl(sqlite3_column_int(stmt, 2));
   value->anonymityLevel = htonl(sqlite3_column_int(stmt, 3));
   value->expirationTime = htonll(sqlite3_column_int64(stmt, 4));

Modified: GNUnet/src/applications/sqstore_sqlite/sqlitetest3.c
===================================================================
--- GNUnet/src/applications/sqstore_sqlite/sqlitetest3.c        2007-06-28 
06:59:06 UTC (rev 5159)
+++ GNUnet/src/applications/sqstore_sqlite/sqlitetest3.c        2007-06-28 
07:11:31 UTC (rev 5160)
@@ -67,7 +67,8 @@
   if (weak_randomi(16) == 0) /* but some of it is less! */
     size = sizeof(Datastore_Value) + weak_randomi(32 * 1024);
   size = size - (size & 7); /* always multiple of 8 */
-
+  GE_ASSERT(NULL,
+           size >= sizeof(Datastore_Value));
   /* generate random key */
   hash(&key,
        sizeof(HashCode512),

Modified: GNUnet/src/include/gnunet_sqstore_service.h
===================================================================
--- GNUnet/src/include/gnunet_sqstore_service.h 2007-06-28 06:59:06 UTC (rev 
5159)
+++ GNUnet/src/include/gnunet_sqstore_service.h 2007-06-28 07:11:31 UTC (rev 
5160)
@@ -60,7 +60,7 @@
   /**
    * Store an item in the datastore.
    *
-   * @return OK on success, SYSERR on error
+   * @return OK on success, SYSERR on error, NO on temporary error
    */
   int (*put)(const HashCode512 * key,
             const Datastore_Value * value);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]