summaryrefslogtreecommitdiff
path: root/src/exchangedb
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-09-03 21:30:14 +0200
committerChristian Grothoff <christian@grothoff.org>2021-09-03 21:30:14 +0200
commit1c1d28d3f5746fac496b517d0b3b78ca1726f01f (patch)
treefb449f75455b24b37fcb2f41ea0b343c6a1a03d1 /src/exchangedb
parent5149af93147c54055d99af688993de3fb4c36ddf (diff)
downloadexchange-1c1d28d3f5746fac496b517d0b3b78ca1726f01f.tar.gz
exchange-1c1d28d3f5746fac496b517d0b3b78ca1726f01f.tar.bz2
exchange-1c1d28d3f5746fac496b517d0b3b78ca1726f01f.zip
first draft for an aggregator benchmark, plus fixing inclusive/exclusive sharding range issues
Diffstat (limited to 'src/exchangedb')
-rw-r--r--src/exchangedb/plugin_exchangedb_postgres.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c
index 70c337c5..961921ea 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -10488,7 +10488,7 @@ postgres_complete_shard (void *cls,
* @param shard_size desired shard size
* @param shard_limit exclusive end of the shard range
* @param[out] start_row inclusive start row of the shard (returned)
- * @param[out] end_row exclusive end row of the shard (returned)
+ * @param[out] end_row inclusive end row of the shard (returned)
* @return transaction status code
*/
static enum GNUNET_DB_QueryStatus
@@ -10517,13 +10517,14 @@ postgres_begin_revolving_shard (void *cls,
/* First, find last 'end_row' */
{
enum GNUNET_DB_QueryStatus qs;
+ uint32_t last_end;
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_string (job_name),
GNUNET_PQ_query_param_end
};
struct GNUNET_PQ_ResultSpec rs[] = {
GNUNET_PQ_result_spec_uint32 ("end_row",
- start_row),
+ &last_end),
GNUNET_PQ_result_spec_end
};
@@ -10541,6 +10542,7 @@ postgres_begin_revolving_shard (void *cls,
postgres_rollback (pg);
continue;
case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
+ *start_row = 1U + last_end;
break;
case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
*start_row = 0; /* base-case: no shards yet */
@@ -10562,7 +10564,7 @@ postgres_begin_revolving_shard (void *cls,
};
*end_row = GNUNET_MIN (shard_limit,
- *start_row + shard_size);
+ *start_row + shard_size - 1);
now = GNUNET_TIME_absolute_get ();
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Trying to claim shard %llu-%llu\n",