gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r30370 - gnunet/src/gns


From: gnunet
Subject: [GNUnet-SVN] r30370 - gnunet/src/gns
Date: Sun, 20 Oct 2013 20:02:39 +0200

Author: grothoff
Date: 2013-10-20 20:02:39 +0200 (Sun, 20 Oct 2013)
New Revision: 30370

Modified:
   gnunet/src/gns/gnunet-service-gns.c
   gnunet/src/gns/test_gns_quickupdate.sh
Log:
-simplify to use new namestore API to skip initial iteration, document now 
passing quickupdate test better

Modified: gnunet/src/gns/gnunet-service-gns.c
===================================================================
--- gnunet/src/gns/gnunet-service-gns.c 2013-10-20 18:01:40 UTC (rev 30369)
+++ gnunet/src/gns/gnunet-service-gns.c 2013-10-20 18:02:39 UTC (rev 30370)
@@ -236,15 +236,6 @@
 static int v4_enabled;
 
 /**
- * Did we finish the initial iteration over the namestore?
- * (while we do the initial iteration, we do not generate
- * DHT PUTs as there might be WAY too many of those).
- * TODO: expand namestore monitor API with a way to
- * suppress this initial iteration.
- */
-static int sync_finished;
-
-/**
  * Handle to the statistics service
  */
 static struct GNUNET_STATISTICS_Handle *statistics;
@@ -485,8 +476,9 @@
                                           label,
                                           &query);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Storing record in DHT with expiration `%s'\n",
-              GNUNET_STRINGS_absolute_time_to_string (expire));
+              "Storing record in DHT with expiration `%s' under key %s\n",
+              GNUNET_STRINGS_absolute_time_to_string (expire),
+              GNUNET_h2s (&query));
   ret = GNUNET_DHT_put (dht_handle, &query,
                         DHT_GNS_REPLICATION_LEVEL,
                         GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE,
@@ -646,9 +638,10 @@
   unsigned int rd_public_count;
   struct MonitorActivity *ma;
 
-  if (GNUNET_YES != sync_finished)
-    return; /* do not do DHT PUTs on initial sync, as that may
-               create far too many PUTs on startup */
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Received %u records for label `%s' via namestore monitor\n",
+              rd_count,
+              label);
   /* filter out records that are not public, and convert to
      absolute expiration time. */
   rd_public_count = convert_records_for_export (rd, rd_count,
@@ -833,7 +826,6 @@
 static void
 monitor_sync_event (void *cls)
 {
-  sync_finished = GNUNET_YES;
   zone_publish_task = GNUNET_SCHEDULER_add_now (&publish_zone_dht_start,
                                                NULL);
 }
@@ -955,9 +947,11 @@
   nc = GNUNET_SERVER_notification_context_create (server, 1);
   zmon = GNUNET_NAMESTORE_zone_monitor_start (c,
                                               NULL,
+                                              GNUNET_NO,
                                               &handle_monitor_event,
                                               &monitor_sync_event,
                                               NULL);
+  GNUNET_break (NULL != zmon);
   GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
                                &shutdown_task, NULL);
 }

Modified: gnunet/src/gns/test_gns_quickupdate.sh
===================================================================
--- gnunet/src/gns/test_gns_quickupdate.sh      2013-10-20 18:01:40 UTC (rev 
30369)
+++ gnunet/src/gns/test_gns_quickupdate.sh      2013-10-20 18:02:39 UTC (rev 
30370)
@@ -9,13 +9,23 @@
 DELEGATED_PKEY=$(gnunet-identity -d -c test_gns_lookup.conf | grep 
delegatedego | awk '{print $3}')
 gnunet-arm -i gns -c test_gns_lookup.conf
 gnunet-namestore -p -z testego -a -n b -t PKEY -V $DELEGATED_PKEY -e never -c 
test_gns_lookup.conf
-sleep 5
+# Give GNS/namestore time to fully start and finish initial iteration
+sleep 2
+# Performing namestore update
 gnunet-namestore -p -z delegatedego -a -n www -t A -V $TEST_IP -e never -c 
test_gns_lookup.conf
+# Give GNS chance to observe store event via monitor
+sleep 1
 gnunet-namestore -z delegatedego -d -n www -t A -V $TEST_IP  -e never -c 
test_gns_lookup.conf
+# give GNS chance to process monitor event
+sleep 1
+# stop everything and restart to check that DHT PUT did happen
 gnunet-arm -k gns -c test_gns_lookup.conf
 gnunet-arm -k namestore -c test_gns_lookup.conf
 gnunet-arm -k namecache -c test_gns_lookup.conf
+# Purge nameacache, as we might otherwise fetch from there
 rm -r `gnunet-config -c test_gns_lookup.conf -s namecache-sqlite -o FILENAME`
+gnunet-arm -i namestore -c test_gns_lookup.conf
+gnunet-arm -i namecache -c test_gns_lookup.conf
 gnunet-arm -i gns -c test_gns_lookup.conf
 RES_IP=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.b.gnu -t A -c 
test_gns_lookup.conf`
 gnunet-namestore -z testego -d -n b -t PKEY -V $DELEGATED_PKEY  -e never -c 
test_gns_lookup.conf




reply via email to

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