summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_db.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchange/taler-exchange-httpd_db.h')
-rw-r--r--src/exchange/taler-exchange-httpd_db.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/exchange/taler-exchange-httpd_db.h b/src/exchange/taler-exchange-httpd_db.h
index c115981d3..482bc5923 100644
--- a/src/exchange/taler-exchange-httpd_db.h
+++ b/src/exchange/taler-exchange-httpd_db.h
@@ -23,20 +23,36 @@
#include <microhttpd.h>
#include "taler_exchangedb_plugin.h"
+#include "taler-exchange-httpd_metrics.h"
#include <gnunet/gnunet_mhd_compat.h>
/**
+ * How often should we retry a transaction before giving up
+ * (for transactions resulting in serialization/dead locks only).
+ *
+ * The current value is likely too high for production. We might want to
+ * benchmark good values once we have a good database setup. The code is
+ * expected to work correctly with any positive value, albeit inefficiently if
+ * we too aggressively force clients to retry the HTTP request merely because
+ * we have database serialization issues.
+ */
+#define MAX_TRANSACTION_COMMIT_RETRIES 100
+
+
+/**
* Ensure coin is known in the database, and handle conflicts and errors.
*
* @param coin the coin to make known
* @param connection MHD request context
+ * @param[out] known_coin_id set to the unique ID for the coin in the DB
* @param[out] mhd_ret set to MHD status on error
* @return transaction status, negative on error (@a mhd_ret will be set in this case)
*/
enum GNUNET_DB_QueryStatus
TEH_make_coin_known (const struct TALER_CoinPublicInfo *coin,
struct MHD_Connection *connection,
+ uint64_t *known_coin_id,
MHD_RESULT *mhd_ret);
@@ -69,6 +85,7 @@ typedef enum GNUNET_DB_QueryStatus
*
* @param connection MHD connection to run @a cb for, can be NULL
* @param name name of the transaction (for debugging)
+ * @param mt type of the requests, for metric generation
* @param[out] mhd_ret set to MHD response code, if transaction failed (returned #GNUNET_SYSERR);
* NULL if we are not running with a @a connection and thus
* must not queue MHD replies
@@ -79,6 +96,7 @@ typedef enum GNUNET_DB_QueryStatus
enum GNUNET_GenericReturnValue
TEH_DB_run_transaction (struct MHD_Connection *connection,
const char *name,
+ enum TEH_MetricTypeRequest mt,
MHD_RESULT *mhd_ret,
TEH_DB_TransactionCallback cb,
void *cb_cls);