summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-09-03 19:08:02 +0200
committerChristian Grothoff <christian@grothoff.org>2021-09-03 19:08:02 +0200
commit5149af93147c54055d99af688993de3fb4c36ddf (patch)
tree8652e56bed70976309412e11c35305a352576a9b /src/include
parent6e1877b142d4819a248b01aebfdd6f337f82a509 (diff)
downloadexchange-5149af93147c54055d99af688993de3fb4c36ddf.tar.gz
exchange-5149af93147c54055d99af688993de3fb4c36ddf.tar.bz2
exchange-5149af93147c54055d99af688993de3fb4c36ddf.zip
preliminary work on supporting sharding/parallel aggregation (undertested, but tests pass again)
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_exchangedb_plugin.h61
1 files changed, 58 insertions, 3 deletions
diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h
index 2521a101..2faf331d 100644
--- a/src/include/taler_exchangedb_plugin.h
+++ b/src/include/taler_exchangedb_plugin.h
@@ -2601,12 +2601,16 @@ struct TALER_EXCHANGEDB_Plugin
* execution time and refund deadlines must both be in the past.
*
* @param cls the @e cls of this struct with the plugin-specific state
+ * @param start_shard_row minimum shard row to select
+ * @param end_shard_row maximum shard row to select (inclusive)
* @param deposit_cb function to call for ONE such deposit
* @param deposit_cb_cls closure for @a deposit_cb
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
(*get_ready_deposit)(void *cls,
+ uint32_t start_shard_row,
+ uint32_t end_shard_row,
TALER_EXCHANGEDB_DepositIterator deposit_cb,
void *deposit_cb_cls);
@@ -2978,15 +2982,15 @@ struct TALER_EXCHANGEDB_Plugin
/**
- * Start a transaction where we transiently violate the foreign
+ * Starts a READ COMMITTED transaction where we transiently violate the foreign
* constraints on the "wire_out" table as we insert aggregations
* and only add the wire transfer out at the end.
*
* @param cls the @e cls of this struct with the plugin-specific state
* @return #GNUNET_OK on success
*/
- int
- (*start_deferred_wire_out) (void *cls);
+ enum GNUNET_GenericReturnValue
+ (*start_deferred_wire_out)(void *cls);
/**
@@ -3746,6 +3750,57 @@ struct TALER_EXCHANGEDB_Plugin
uint64_t start_row,
uint64_t end_row);
+
+ /**
+ * Function called to grab a revolving work shard on an operation @a op. Runs
+ * in its own transaction. Returns the oldest inactive shard.
+ *
+ * @param cls the @e cls of this struct with the plugin-specific state
+ * @param job_name name of the operation to grab a revolving shard for
+ * @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)
+ * @return transaction status code
+ */
+ enum GNUNET_DB_QueryStatus
+ (*begin_revolving_shard)(void *cls,
+ const char *job_name,
+ uint32_t shard_size,
+ uint32_t shard_limit,
+ uint32_t *start_row,
+ uint32_t *end_row);
+
+
+ /**
+ * Function called to release a revolving shard back into the work pool.
+ * Clears the "completed" flag.
+ *
+ * @param cls the @e cls of this struct with the plugin-specific state
+ * @param job_name name of the operation to grab a word shard for
+ * @param start_row inclusive start row of the shard
+ * @param end_row exclusive end row of the shard
+ * @return transaction status code
+ */
+ enum GNUNET_DB_QueryStatus
+ (*release_revolving_shard)(void *cls,
+ const char *job_name,
+ uint32_t start_row,
+ uint32_t end_row);
+
+
+ /**
+ * Function called to delete all revolving shards.
+ * To be used after a crash or when the shard size is
+ * changed.
+ *
+ * @param cls the @e cls of this struct with the plugin-specific state
+ * @return transaction status code
+ */
+ enum GNUNET_DB_QueryStatus
+ (*delete_revolving_shards)(void *cls);
+
+
};
#endif /* _TALER_EXCHANGE_DB_H */