aboutsummaryrefslogtreecommitdiff
path: root/src/datastore
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-08-03 10:29:09 +0000
committerChristian Grothoff <christian@grothoff.org>2015-08-03 10:29:09 +0000
commit722a93c626d4033abbb221f44238fd7e25f99b0d (patch)
tree3cc42f7c84a90e4e9eb3ce64a2b804aba43e6b53 /src/datastore
parent1b49daf277669a740f2a0a2dc78dd637832b552f (diff)
downloadgnunet-722a93c626d4033abbb221f44238fd7e25f99b0d.tar.gz
gnunet-722a93c626d4033abbb221f44238fd7e25f99b0d.zip
-reduce autostarting for tests, reduce timeouts
Diffstat (limited to 'src/datastore')
-rw-r--r--src/datastore/datastore_api.c52
-rw-r--r--src/datastore/gnunet-service-datastore.c128
-rw-r--r--src/datastore/perf_datastore_api.c13
-rw-r--r--src/datastore/test_datastore_api.c2
-rw-r--r--src/datastore/test_datastore_api_data_mysql.conf10
-rw-r--r--src/datastore/test_datastore_api_data_postgres.conf11
-rw-r--r--src/datastore/test_datastore_api_data_sqlite.conf12
-rw-r--r--src/datastore/test_defaults.conf6
8 files changed, 138 insertions, 96 deletions
diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c
index d7e933fc6..a5b3e9088 100644
--- a/src/datastore/datastore_api.c
+++ b/src/datastore/datastore_api.c
@@ -328,7 +328,8 @@ transmit_drop (void *cls, size_t size, void *buf)
328 * @param drop set to #GNUNET_YES to delete all data in datastore (!) 328 * @param drop set to #GNUNET_YES to delete all data in datastore (!)
329 */ 329 */
330void 330void
331GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h, int drop) 331GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h,
332 int drop)
332{ 333{
333 struct GNUNET_DATASTORE_QueueEntry *qe; 334 struct GNUNET_DATASTORE_QueueEntry *qe;
334 335
@@ -338,12 +339,12 @@ GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h, int drop)
338 GNUNET_CLIENT_notify_transmit_ready_cancel (h->th); 339 GNUNET_CLIENT_notify_transmit_ready_cancel (h->th);
339 h->th = NULL; 340 h->th = NULL;
340 } 341 }
341 if (h->client != NULL) 342 if (NULL != h->client)
342 { 343 {
343 GNUNET_CLIENT_disconnect (h->client); 344 GNUNET_CLIENT_disconnect (h->client);
344 h->client = NULL; 345 h->client = NULL;
345 } 346 }
346 if (h->reconnect_task != NULL) 347 if (NULL != h->reconnect_task)
347 { 348 {
348 GNUNET_SCHEDULER_cancel (h->reconnect_task); 349 GNUNET_SCHEDULER_cancel (h->reconnect_task);
349 h->reconnect_task = NULL; 350 h->reconnect_task = NULL;
@@ -356,21 +357,23 @@ GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h, int drop)
356 if (GNUNET_YES == drop) 357 if (GNUNET_YES == drop)
357 { 358 {
358 h->client = GNUNET_CLIENT_connect ("datastore", h->cfg); 359 h->client = GNUNET_CLIENT_connect ("datastore", h->cfg);
359 if (h->client != NULL) 360 if (NULL != h->client)
360 { 361 {
361 if (NULL != 362 if (NULL !=
362 GNUNET_CLIENT_notify_transmit_ready (h->client, 363 GNUNET_CLIENT_notify_transmit_ready (h->client,
363 sizeof (struct 364 sizeof (struct
364 GNUNET_MessageHeader), 365 GNUNET_MessageHeader),
365 GNUNET_TIME_UNIT_MINUTES, 366 GNUNET_TIME_UNIT_SECONDS,
366 GNUNET_YES, &transmit_drop, h)) 367 GNUNET_YES,
368 &transmit_drop, h))
367 return; 369 return;
368 GNUNET_CLIENT_disconnect (h->client); 370 GNUNET_CLIENT_disconnect (h->client);
369 h->client = NULL; 371 h->client = NULL;
370 } 372 }
371 GNUNET_break (0); 373 GNUNET_break (0);
372 } 374 }
373 GNUNET_STATISTICS_destroy (h->stats, GNUNET_NO); 375 GNUNET_STATISTICS_destroy (h->stats,
376 GNUNET_NO);
374 h->stats = NULL; 377 h->stats = NULL;
375 GNUNET_free (h); 378 GNUNET_free (h);
376} 379}
@@ -396,8 +399,12 @@ timeout_queue_entry (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
396 LOG (GNUNET_ERROR_TYPE_DEBUG, 399 LOG (GNUNET_ERROR_TYPE_DEBUG,
397 "Timeout of request in datastore queue\n"); 400 "Timeout of request in datastore queue\n");
398 /* response_proc's expect request at the head of the queue! */ 401 /* response_proc's expect request at the head of the queue! */
399 GNUNET_CONTAINER_DLL_remove (h->queue_head, h->queue_tail, qe); 402 GNUNET_CONTAINER_DLL_remove (h->queue_head,
400 GNUNET_CONTAINER_DLL_insert (h->queue_head, h->queue_tail, qe); 403 h->queue_tail,
404 qe);
405 GNUNET_CONTAINER_DLL_insert (h->queue_head,
406 h->queue_tail,
407 qe);
401 GNUNET_assert (h->queue_head == qe); 408 GNUNET_assert (h->queue_head == qe);
402 qe->response_proc (qe->h, NULL); 409 qe->response_proc (qe->h, NULL);
403} 410}
@@ -418,8 +425,10 @@ timeout_queue_entry (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
418 * @return NULL if the queue is full 425 * @return NULL if the queue is full
419 */ 426 */
420static struct GNUNET_DATASTORE_QueueEntry * 427static struct GNUNET_DATASTORE_QueueEntry *
421make_queue_entry (struct GNUNET_DATASTORE_Handle *h, size_t msize, 428make_queue_entry (struct GNUNET_DATASTORE_Handle *h,
422 unsigned int queue_priority, unsigned int max_queue_size, 429 size_t msize,
430 unsigned int queue_priority,
431 unsigned int max_queue_size,
423 struct GNUNET_TIME_Relative timeout, 432 struct GNUNET_TIME_Relative timeout,
424 GNUNET_CLIENT_MessageHandler response_proc, 433 GNUNET_CLIENT_MessageHandler response_proc,
425 const union QueueContext *qc) 434 const union QueueContext *qc)
@@ -856,13 +865,18 @@ process_status_message (void *cls,
856 * (or rather, will already have been invoked) 865 * (or rather, will already have been invoked)
857 */ 866 */
858struct GNUNET_DATASTORE_QueueEntry * 867struct GNUNET_DATASTORE_QueueEntry *
859GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h, uint32_t rid, 868GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h,
860 const struct GNUNET_HashCode * key, size_t size, 869 uint32_t rid,
861 const void *data, enum GNUNET_BLOCK_Type type, 870 const struct GNUNET_HashCode *key,
862 uint32_t priority, uint32_t anonymity, 871 size_t size,
872 const void *data,
873 enum GNUNET_BLOCK_Type type,
874 uint32_t priority,
875 uint32_t anonymity,
863 uint32_t replication, 876 uint32_t replication,
864 struct GNUNET_TIME_Absolute expiration, 877 struct GNUNET_TIME_Absolute expiration,
865 unsigned int queue_priority, unsigned int max_queue_size, 878 unsigned int queue_priority,
879 unsigned int max_queue_size,
866 struct GNUNET_TIME_Relative timeout, 880 struct GNUNET_TIME_Relative timeout,
867 GNUNET_DATASTORE_ContinuationWithStatus cont, 881 GNUNET_DATASTORE_ContinuationWithStatus cont,
868 void *cont_cls) 882 void *cont_cls)
@@ -881,7 +895,11 @@ GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h, uint32_t rid,
881 GNUNET_assert (msize < GNUNET_SERVER_MAX_MESSAGE_SIZE); 895 GNUNET_assert (msize < GNUNET_SERVER_MAX_MESSAGE_SIZE);
882 qc.sc.cont = cont; 896 qc.sc.cont = cont;
883 qc.sc.cont_cls = cont_cls; 897 qc.sc.cont_cls = cont_cls;
884 qe = make_queue_entry (h, msize, queue_priority, max_queue_size, timeout, 898 qe = make_queue_entry (h,
899 msize,
900 queue_priority,
901 max_queue_size,
902 timeout,
885 &process_status_message, &qc); 903 &process_status_message, &qc);
886 if (qe == NULL) 904 if (qe == NULL)
887 { 905 {
diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c
index 77e96c94f..3561fb406 100644
--- a/src/datastore/gnunet-service-datastore.c
+++ b/src/datastore/gnunet-service-datastore.c
@@ -224,8 +224,14 @@ static int stats_worked;
224static void 224static void
225sync_stats () 225sync_stats ()
226{ 226{
227 GNUNET_STATISTICS_set (stats, quota_stat_name, payload, GNUNET_YES); 227 GNUNET_STATISTICS_set (stats,
228 GNUNET_STATISTICS_set (stats, "# utilization by current datastore", payload, GNUNET_NO); 228 quota_stat_name,
229 payload,
230 GNUNET_YES);
231 GNUNET_STATISTICS_set (stats,
232 "# utilization by current datastore",
233 payload,
234 GNUNET_NO);
229 last_sync = 0; 235 last_sync = 0;
230} 236}
231 237
@@ -362,7 +368,9 @@ expired_processor (void *cls,
362 now), 368 now),
363 GNUNET_YES)); 369 GNUNET_YES));
364 min_expiration = now; 370 min_expiration = now;
365 GNUNET_STATISTICS_update (stats, gettext_noop ("# bytes expired"), size, 371 GNUNET_STATISTICS_update (stats,
372 gettext_noop ("# bytes expired"),
373 size,
366 GNUNET_YES); 374 GNUNET_YES);
367 GNUNET_CONTAINER_bloomfilter_remove (filter, key); 375 GNUNET_CONTAINER_bloomfilter_remove (filter, key);
368 expired_kill_task = 376 expired_kill_task =
@@ -640,7 +648,9 @@ transmit_item (void *cls, const struct GNUNET_HashCode * key, uint32_t size,
640 GNUNET_STRINGS_absolute_time_to_string (expiration), 648 GNUNET_STRINGS_absolute_time_to_string (expiration),
641 GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_remaining (expiration), 649 GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_remaining (expiration),
642 GNUNET_YES)); 650 GNUNET_YES));
643 GNUNET_STATISTICS_update (stats, gettext_noop ("# results found"), 1, 651 GNUNET_STATISTICS_update (stats,
652 gettext_noop ("# results found"),
653 1,
644 GNUNET_NO); 654 GNUNET_NO);
645 transmit (client, &dm->header); 655 transmit (client, &dm->header);
646 GNUNET_SERVER_client_drop (client); 656 GNUNET_SERVER_client_drop (client);
@@ -709,7 +719,9 @@ handle_reserve (void *cls, struct GNUNET_SERVER_Client *client,
709 return; 719 return;
710 } 720 }
711 reserved += req; 721 reserved += req;
712 GNUNET_STATISTICS_set (stats, gettext_noop ("# reserved"), reserved, 722 GNUNET_STATISTICS_set (stats,
723 gettext_noop ("# reserved"),
724 reserved,
713 GNUNET_NO); 725 GNUNET_NO);
714 e = GNUNET_new (struct ReservationList); 726 e = GNUNET_new (struct ReservationList);
715 e->next = reservations; 727 e->next = reservations;
@@ -764,7 +776,8 @@ handle_release_reserve (void *cls,
764 GNUNET_assert (reserved >= rem); 776 GNUNET_assert (reserved >= rem);
765 reserved -= rem; 777 reserved -= rem;
766 GNUNET_STATISTICS_set (stats, 778 GNUNET_STATISTICS_set (stats,
767 gettext_noop ("# reserved"), reserved, 779 gettext_noop ("# reserved"),
780 reserved,
768 GNUNET_NO); 781 GNUNET_NO);
769 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 782 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
770 "Returning %llu remaining reserved bytes to storage pool\n", 783 "Returning %llu remaining reserved bytes to storage pool\n",
@@ -839,8 +852,8 @@ struct PutContext
839 * @param msg error message on error 852 * @param msg error message on error
840 */ 853 */
841static void 854static void
842put_continuation (void *cls, 855put_continuation (void *cls,
843 const struct GNUNET_HashCode *key, 856 const struct GNUNET_HashCode *key,
844 uint32_t size, 857 uint32_t size,
845 int status, 858 int status,
846 const char *msg) 859 const char *msg)
@@ -850,7 +863,8 @@ put_continuation (void *cls,
850 if (GNUNET_OK == status) 863 if (GNUNET_OK == status)
851 { 864 {
852 GNUNET_STATISTICS_update (stats, 865 GNUNET_STATISTICS_update (stats,
853 gettext_noop ("# bytes stored"), size, 866 gettext_noop ("# bytes stored"),
867 size,
854 GNUNET_YES); 868 GNUNET_YES);
855 GNUNET_CONTAINER_bloomfilter_add (filter, key); 869 GNUNET_CONTAINER_bloomfilter_add (filter, key);
856 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 870 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -870,6 +884,7 @@ put_continuation (void *cls,
870 } 884 }
871} 885}
872 886
887
873/** 888/**
874 * Actually put the data message. 889 * Actually put the data message.
875 * 890 *
@@ -877,7 +892,8 @@ put_continuation (void *cls,
877 * @param dm message with the data to store 892 * @param dm message with the data to store
878 */ 893 */
879static void 894static void
880execute_put (struct GNUNET_SERVER_Client *client, const struct DataMessage *dm) 895execute_put (struct GNUNET_SERVER_Client *client,
896 const struct DataMessage *dm)
881{ 897{
882 GNUNET_SERVER_client_keep (client); 898 GNUNET_SERVER_client_keep (client);
883 plugin->api->put (plugin->api->cls, &dm->key, ntohl (dm->size), &dm[1], 899 plugin->api->put (plugin->api->cls, &dm->key, ntohl (dm->size), &dm[1],
@@ -889,8 +905,8 @@ execute_put (struct GNUNET_SERVER_Client *client, const struct DataMessage *dm)
889 905
890 906
891static void 907static void
892check_present_continuation (void *cls, 908check_present_continuation (void *cls,
893 int status, 909 int status,
894 const char *msg) 910 const char *msg)
895{ 911{
896 struct GNUNET_SERVER_Client *client = cls; 912 struct GNUNET_SERVER_Client *client = cls;
@@ -918,13 +934,13 @@ check_present_continuation (void *cls,
918 * #GNUNET_NO to delete the item 934 * #GNUNET_NO to delete the item
919 */ 935 */
920static int 936static int
921check_present (void *cls, 937check_present (void *cls,
922 const struct GNUNET_HashCode *key, 938 const struct GNUNET_HashCode *key,
923 uint32_t size, 939 uint32_t size,
924 const void *data, 940 const void *data,
925 enum GNUNET_BLOCK_Type type, 941 enum GNUNET_BLOCK_Type type,
926 uint32_t priority, 942 uint32_t priority,
927 uint32_t anonymity, 943 uint32_t anonymity,
928 struct GNUNET_TIME_Absolute expiration, 944 struct GNUNET_TIME_Absolute expiration,
929 uint64_t uid) 945 uint64_t uid)
930{ 946{
@@ -950,7 +966,7 @@ check_present (void *cls,
950 if ((ntohl (dm->priority) > 0) || 966 if ((ntohl (dm->priority) > 0) ||
951 (GNUNET_TIME_absolute_ntoh (dm->expiration).abs_value_us > 967 (GNUNET_TIME_absolute_ntoh (dm->expiration).abs_value_us >
952 expiration.abs_value_us)) 968 expiration.abs_value_us))
953 plugin->api->update (plugin->api->cls, 969 plugin->api->update (plugin->api->cls,
954 uid, 970 uid,
955 (int32_t) ntohl (dm->priority), 971 (int32_t) ntohl (dm->priority),
956 GNUNET_TIME_absolute_ntoh (dm->expiration), 972 GNUNET_TIME_absolute_ntoh (dm->expiration),
@@ -1016,7 +1032,8 @@ handle_put (void *cls, struct GNUNET_SERVER_Client *client,
1016 pos->amount -= size; 1032 pos->amount -= size;
1017 reserved -= (size + GNUNET_DATASTORE_ENTRY_OVERHEAD); 1033 reserved -= (size + GNUNET_DATASTORE_ENTRY_OVERHEAD);
1018 GNUNET_STATISTICS_set (stats, 1034 GNUNET_STATISTICS_set (stats,
1019 gettext_noop ("# reserved"), reserved, 1035 gettext_noop ("# reserved"),
1036 reserved,
1020 GNUNET_NO); 1037 GNUNET_NO);
1021 } 1038 }
1022 } 1039 }
@@ -1029,11 +1046,11 @@ handle_put (void *cls, struct GNUNET_SERVER_Client *client,
1029 GNUNET_SERVER_client_keep (client); 1046 GNUNET_SERVER_client_keep (client);
1030 memcpy (&pc[1], dm, size + sizeof (struct DataMessage)); 1047 memcpy (&pc[1], dm, size + sizeof (struct DataMessage));
1031 plugin->api->get_key (plugin->api->cls, 1048 plugin->api->get_key (plugin->api->cls,
1032 0, 1049 0,
1033 &dm->key, 1050 &dm->key,
1034 &vhash, 1051 &vhash,
1035 ntohl (dm->type), 1052 ntohl (dm->type),
1036 &check_present, 1053 &check_present,
1037 pc); 1054 pc);
1038 return; 1055 return;
1039 } 1056 }
@@ -1068,7 +1085,8 @@ handle_get (void *cls, struct GNUNET_SERVER_Client *client,
1068 "Processing `%s' request for `%s' of type %u\n", "GET", 1085 "Processing `%s' request for `%s' of type %u\n", "GET",
1069 GNUNET_h2s (&msg->key), ntohl (msg->type)); 1086 GNUNET_h2s (&msg->key), ntohl (msg->type));
1070 GNUNET_STATISTICS_update (stats, 1087 GNUNET_STATISTICS_update (stats,
1071 gettext_noop ("# GET requests received"), 1, 1088 gettext_noop ("# GET requests received"),
1089 1,
1072 GNUNET_NO); 1090 GNUNET_NO);
1073 GNUNET_SERVER_client_keep (client); 1091 GNUNET_SERVER_client_keep (client);
1074 if ((size == sizeof (struct GetMessage)) && 1092 if ((size == sizeof (struct GetMessage)) &&
@@ -1080,7 +1098,8 @@ handle_get (void *cls, struct GNUNET_SERVER_Client *client,
1080 "GET", GNUNET_h2s (&msg->key)); 1098 "GET", GNUNET_h2s (&msg->key));
1081 GNUNET_STATISTICS_update (stats, 1099 GNUNET_STATISTICS_update (stats,
1082 gettext_noop 1100 gettext_noop
1083 ("# requests filtered by bloomfilter"), 1, 1101 ("# requests filtered by bloomfilter"),
1102 1,
1084 GNUNET_NO); 1103 GNUNET_NO);
1085 transmit_item (client, NULL, 0, NULL, 0, 0, 0, GNUNET_TIME_UNIT_ZERO_ABS, 1104 transmit_item (client, NULL, 0, NULL, 0, 0, 0, GNUNET_TIME_UNIT_ZERO_ABS,
1086 0); 1105 0);
@@ -1094,8 +1113,8 @@ handle_get (void *cls, struct GNUNET_SERVER_Client *client,
1094 1113
1095 1114
1096static void 1115static void
1097update_continuation (void *cls, 1116update_continuation (void *cls,
1098 int status, 1117 int status,
1099 const char *msg) 1118 const char *msg)
1100{ 1119{
1101 struct GNUNET_SERVER_Client *client = cls; 1120 struct GNUNET_SERVER_Client *client = cls;
@@ -1118,8 +1137,10 @@ handle_update (void *cls, struct GNUNET_SERVER_Client *client,
1118{ 1137{
1119 const struct UpdateMessage *msg; 1138 const struct UpdateMessage *msg;
1120 1139
1121 GNUNET_STATISTICS_update (stats, gettext_noop ("# UPDATE requests received"), 1140 GNUNET_STATISTICS_update (stats,
1122 1, GNUNET_NO); 1141 gettext_noop ("# UPDATE requests received"),
1142 1,
1143 GNUNET_NO);
1123 msg = (const struct UpdateMessage *) message; 1144 msg = (const struct UpdateMessage *) message;
1124 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request for %llu\n", 1145 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request for %llu\n",
1125 "UPDATE", (unsigned long long) GNUNET_ntohll (msg->uid)); 1146 "UPDATE", (unsigned long long) GNUNET_ntohll (msg->uid));
@@ -1142,11 +1163,12 @@ static void
1142handle_get_replication (void *cls, struct GNUNET_SERVER_Client *client, 1163handle_get_replication (void *cls, struct GNUNET_SERVER_Client *client,
1143 const struct GNUNET_MessageHeader *message) 1164 const struct GNUNET_MessageHeader *message)
1144{ 1165{
1145 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request\n", 1166 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1167 "Processing `%s' request\n",
1146 "GET_REPLICATION"); 1168 "GET_REPLICATION");
1147 GNUNET_STATISTICS_update (stats, 1169 GNUNET_STATISTICS_update (stats,
1148 gettext_noop 1170 gettext_noop ("# GET REPLICATION requests received"),
1149 ("# GET REPLICATION requests received"), 1, 1171 1,
1150 GNUNET_NO); 1172 GNUNET_NO);
1151 GNUNET_SERVER_client_keep (client); 1173 GNUNET_SERVER_client_keep (client);
1152 plugin->api->get_replication (plugin->api->cls, &transmit_item, client); 1174 plugin->api->get_replication (plugin->api->cls, &transmit_item, client);
@@ -1175,11 +1197,12 @@ handle_get_zero_anonymity (void *cls, struct GNUNET_SERVER_Client *client,
1175 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 1197 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
1176 return; 1198 return;
1177 } 1199 }
1178 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request\n", 1200 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1201 "Processing `%s' request\n",
1179 "GET_ZERO_ANONYMITY"); 1202 "GET_ZERO_ANONYMITY");
1180 GNUNET_STATISTICS_update (stats, 1203 GNUNET_STATISTICS_update (stats,
1181 gettext_noop 1204 gettext_noop ("# GET ZERO ANONYMITY requests received"),
1182 ("# GET ZERO ANONYMITY requests received"), 1, 1205 1,
1183 GNUNET_NO); 1206 GNUNET_NO);
1184 GNUNET_SERVER_client_keep (client); 1207 GNUNET_SERVER_client_keep (client);
1185 plugin->api->get_zero_anonymity (plugin->api->cls, 1208 plugin->api->get_zero_anonymity (plugin->api->cls,
@@ -1203,17 +1226,24 @@ remove_callback (void *cls, const struct GNUNET_HashCode * key, uint32_t size,
1203 if (key == NULL) 1226 if (key == NULL)
1204 { 1227 {
1205 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1228 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1206 "No further matches for `%s' request.\n", "REMOVE"); 1229 "No further matches for `%s' request.\n",
1207 transmit_status (client, GNUNET_NO, _("Content not found")); 1230 "REMOVE");
1231 transmit_status (client,
1232 GNUNET_NO,
1233 _("Content not found"));
1208 GNUNET_SERVER_client_drop (client); 1234 GNUNET_SERVER_client_drop (client);
1209 return GNUNET_OK; /* last item */ 1235 return GNUNET_OK; /* last item */
1210 } 1236 }
1211 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1237 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1212 "Item %llu matches `%s' request for key `%s' and type %u.\n", 1238 "Item %llu matches `%s' request for key `%s' and type %u.\n",
1213 (unsigned long long) uid, "REMOVE", GNUNET_h2s (key), type); 1239 (unsigned long long) uid,
1240 "REMOVE",
1241 GNUNET_h2s (key),
1242 type);
1214 GNUNET_STATISTICS_update (stats, 1243 GNUNET_STATISTICS_update (stats,
1215 gettext_noop ("# bytes removed (explicit request)"), 1244 gettext_noop ("# bytes removed (explicit request)"),
1216 size, GNUNET_YES); 1245 size,
1246 GNUNET_YES);
1217 GNUNET_CONTAINER_bloomfilter_remove (filter, key); 1247 GNUNET_CONTAINER_bloomfilter_remove (filter, key);
1218 transmit_status (client, GNUNET_OK, NULL); 1248 transmit_status (client, GNUNET_OK, NULL);
1219 GNUNET_SERVER_client_drop (client); 1249 GNUNET_SERVER_client_drop (client);
@@ -1449,7 +1479,8 @@ add_key_to_bloomfilter (void *cls,
1449 * @param success #GNUNET_NO if we failed to read the stat 1479 * @param success #GNUNET_NO if we failed to read the stat
1450 */ 1480 */
1451static void 1481static void
1452process_stat_done (void *cls, int success) 1482process_stat_done (void *cls,
1483 int success)
1453{ 1484{
1454 1485
1455 stat_get = NULL; 1486 stat_get = NULL;
@@ -1469,7 +1500,8 @@ process_stat_done (void *cls, int success)
1469 { 1500 {
1470 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1501 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1471 "Failed to obtain value from statistics service, recomputing it\n"); 1502 "Failed to obtain value from statistics service, recomputing it\n");
1472 plugin->api->estimate_size (plugin->api->cls, &payload); 1503 plugin->api->estimate_size (plugin->api->cls,
1504 &payload);
1473 } 1505 }
1474 if (GNUNET_YES == refresh_bf) 1506 if (GNUNET_YES == refresh_bf)
1475 { 1507 {
@@ -1594,7 +1626,9 @@ cleanup_reservations (void *cls,
1594 } 1626 }
1595 pos = next; 1627 pos = next;
1596 } 1628 }
1597 GNUNET_STATISTICS_set (stats, gettext_noop ("# reserved"), reserved, 1629 GNUNET_STATISTICS_set (stats,
1630 gettext_noop ("# reserved"),
1631 reserved,
1598 GNUNET_NO); 1632 GNUNET_NO);
1599} 1633}
1600 1634
@@ -1618,11 +1652,14 @@ run (void *cls,
1618 server = serv; 1652 server = serv;
1619 cfg = c; 1653 cfg = c;
1620 if (GNUNET_OK != 1654 if (GNUNET_OK !=
1621 GNUNET_CONFIGURATION_get_value_string (cfg, "DATASTORE", "DATABASE", 1655 GNUNET_CONFIGURATION_get_value_string (cfg,
1656 "DATASTORE",
1657 "DATABASE",
1622 &plugin_name)) 1658 &plugin_name))
1623 { 1659 {
1624 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1660 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1625 _("No `%s' specified for `%s' in configuration!\n"), "DATABASE", 1661 _("No `%s' specified for `%s' in configuration!\n"),
1662 "DATABASE",
1626 "DATASTORE"); 1663 "DATASTORE");
1627 return; 1664 return;
1628 } 1665 }
@@ -1633,7 +1670,8 @@ run (void *cls,
1633 GNUNET_CONFIGURATION_get_value_size (cfg, "DATASTORE", "QUOTA", &quota)) 1670 GNUNET_CONFIGURATION_get_value_size (cfg, "DATASTORE", "QUOTA", &quota))
1634 { 1671 {
1635 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1672 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1636 _("No `%s' specified for `%s' in configuration!\n"), "QUOTA", 1673 _("No `%s' specified for `%s' in configuration!\n"),
1674 "QUOTA",
1637 "DATASTORE"); 1675 "DATASTORE");
1638 return; 1676 return;
1639 } 1677 }
@@ -1648,7 +1686,9 @@ run (void *cls,
1648 bf_size = quota / (32 * 1024LL); /* 8 bit per entry, 1 bit per 32 kb in DB */ 1686 bf_size = quota / (32 * 1024LL); /* 8 bit per entry, 1 bit per 32 kb in DB */
1649 fn = NULL; 1687 fn = NULL;
1650 if ((GNUNET_OK != 1688 if ((GNUNET_OK !=
1651 GNUNET_CONFIGURATION_get_value_filename (cfg, "DATASTORE", "BLOOMFILTER", 1689 GNUNET_CONFIGURATION_get_value_filename (cfg,
1690 "DATASTORE",
1691 "BLOOMFILTER",
1652 &fn)) || 1692 &fn)) ||
1653 (GNUNET_OK != GNUNET_DISK_directory_create_for_file (fn))) 1693 (GNUNET_OK != GNUNET_DISK_directory_create_for_file (fn)))
1654 { 1694 {
diff --git a/src/datastore/perf_datastore_api.c b/src/datastore/perf_datastore_api.c
index 082b583c6..c3dbad00a 100644
--- a/src/datastore/perf_datastore_api.c
+++ b/src/datastore/perf_datastore_api.c
@@ -407,11 +407,22 @@ run_continuation (void *cls,
407 "DATASTORE-%s", 407 "DATASTORE-%s",
408 plugin_name); 408 plugin_name);
409 if ((crc->i == ITERATIONS) && (stored_ops > 0)) 409 if ((crc->i == ITERATIONS) && (stored_ops > 0))
410 {
410 GAUGER (gstr, 411 GAUGER (gstr,
411 "PUT operation duration", 412 "PUT operation duration",
412 GNUNET_TIME_absolute_get_duration (start_time).rel_value_us / 1000LL / 413 GNUNET_TIME_absolute_get_duration (start_time).rel_value_us / 1000LL /
413 stored_ops, 414 stored_ops,
414 "ms/operation"); 415 "ms/operation");
416 fprintf (stdout,
417 "\nPUT performance: %s for %llu operations\n",
418 GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_duration (start_time),
419 GNUNET_YES),
420 stored_ops);
421 fprintf (stdout,
422 "PUT performance: %llu ms/operation\n",
423 GNUNET_TIME_absolute_get_duration (start_time).rel_value_us / 1000LL /
424 stored_ops);
425 }
415 GNUNET_DATASTORE_disconnect (datastore, 426 GNUNET_DATASTORE_disconnect (datastore,
416 GNUNET_YES); 427 GNUNET_YES);
417 GNUNET_free (crc); 428 GNUNET_free (crc);
@@ -493,7 +504,7 @@ run (void *cls,
493 0, 0, 0, 504 0, 0, 0,
494 GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_SECONDS), 505 GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_SECONDS),
495 0, 1, 506 0, 1,
496 GNUNET_TIME_UNIT_MINUTES, 507 TIMEOUT,
497 &run_tests, crc)) 508 &run_tests, crc))
498 { 509 {
499 FPRINTF (stderr, 510 FPRINTF (stderr,
diff --git a/src/datastore/test_datastore_api.c b/src/datastore/test_datastore_api.c
index 36e637845..a8011bd53 100644
--- a/src/datastore/test_datastore_api.c
+++ b/src/datastore/test_datastore_api.c
@@ -639,7 +639,7 @@ run (void *cls,
639 GNUNET_TIME_relative_to_absolute 639 GNUNET_TIME_relative_to_absolute
640 (GNUNET_TIME_UNIT_SECONDS), 640 (GNUNET_TIME_UNIT_SECONDS),
641 0, 1, 641 0, 1,
642 GNUNET_TIME_UNIT_MINUTES, 642 TIMEOUT,
643 &run_tests, crc)) 643 &run_tests, crc))
644 { 644 {
645 FPRINTF (stderr, 645 FPRINTF (stderr,
diff --git a/src/datastore/test_datastore_api_data_mysql.conf b/src/datastore/test_datastore_api_data_mysql.conf
index f79c62d17..de6fff7ab 100644
--- a/src/datastore/test_datastore_api_data_mysql.conf
+++ b/src/datastore/test_datastore_api_data_mysql.conf
@@ -2,19 +2,9 @@
2[PATHS] 2[PATHS]
3GNUNET_TEST_HOME = /tmp/test-gnunet-datastore-mysql/ 3GNUNET_TEST_HOME = /tmp/test-gnunet-datastore-mysql/
4 4
5[arm]
6PORT = 42466
7
8[statistics]
9PORT = 22667
10
11[resolver]
12PORT = 42464
13
14[datastore] 5[datastore]
15QUOTA = 10 MB 6QUOTA = 10 MB
16DATABASE = mysql 7DATABASE = mysql
17 8
18[datastore-mysql] 9[datastore-mysql]
19DATABASE = gnunetcheck 10DATABASE = gnunetcheck
20
diff --git a/src/datastore/test_datastore_api_data_postgres.conf b/src/datastore/test_datastore_api_data_postgres.conf
index c30f1f10e..f436530d2 100644
--- a/src/datastore/test_datastore_api_data_postgres.conf
+++ b/src/datastore/test_datastore_api_data_postgres.conf
@@ -2,20 +2,9 @@
2[PATHS] 2[PATHS]
3GNUNET_TEST_HOME = /tmp/test-gnunet-datastore-postgres/ 3GNUNET_TEST_HOME = /tmp/test-gnunet-datastore-postgres/
4 4
5[arm]
6PORT = 42466
7
8[statistics]
9PORT = 22667
10
11[resolver]
12PORT = 42464
13
14[datastore] 5[datastore]
15QUOTA = 10 MB 6QUOTA = 10 MB
16DATABASE = postgres 7DATABASE = postgres
17 8
18[datastore-postgres] 9[datastore-postgres]
19CONFIG = dbname=gnunetcheck 10CONFIG = dbname=gnunetcheck
20
21
diff --git a/src/datastore/test_datastore_api_data_sqlite.conf b/src/datastore/test_datastore_api_data_sqlite.conf
index 6a6e00787..894945586 100644
--- a/src/datastore/test_datastore_api_data_sqlite.conf
+++ b/src/datastore/test_datastore_api_data_sqlite.conf
@@ -2,16 +2,6 @@
2[PATHS] 2[PATHS]
3GNUNET_TEST_HOME = /tmp/test-gnunet-datastore-sqlite/ 3GNUNET_TEST_HOME = /tmp/test-gnunet-datastore-sqlite/
4 4
5[arm]
6PORT = 42466
7
8[statistics]
9PORT = 22667
10
11[resolver]
12PORT = 42464
13
14[datastore] 5[datastore]
15QUOTA = 10 MB 6QUOTA = 10 MB
16 7DATABASE = sqlite
17
diff --git a/src/datastore/test_defaults.conf b/src/datastore/test_defaults.conf
index 1edde7c5a..67d782f3a 100644
--- a/src/datastore/test_defaults.conf
+++ b/src/datastore/test_defaults.conf
@@ -1,6 +1,10 @@
1@inline@ ../../contrib/no_autostart_above_core.conf
2@inline@ ../../contrib/no_forcestart.conf
3
1[datastore] 4[datastore]
2PORT = 22654 5PORT = 22654
3QUOTA = 1 MB 6QUOTA = 1 MB
7AUTOSTART = YES
4 8
5[nse] 9[nse]
6WORKBITS = 1 \ No newline at end of file 10WORKBITS = 1