diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-09-03 21:30:14 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-09-03 21:30:14 +0200 |
commit | 1c1d28d3f5746fac496b517d0b3b78ca1726f01f (patch) | |
tree | fb449f75455b24b37fcb2f41ea0b343c6a1a03d1 /src/exchangedb | |
parent | 5149af93147c54055d99af688993de3fb4c36ddf (diff) | |
download | exchange-1c1d28d3f5746fac496b517d0b3b78ca1726f01f.tar.xz |
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.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c index 70c337c57..961921eaa 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", |