commit 9a8fca09c6e8370d53a6cd7e7000e3aa42b84b3f
parent db3c030072ee9193c24a60d1eb928a5c8dce9428
Author: Christian Grothoff <christian@grothoff.org>
Date: Tue, 30 Jun 2026 15:05:26 +0200
make use of transaction_name in auditor
Diffstat:
8 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/src/auditor/report-lib.c b/src/auditor/report-lib.c
@@ -370,7 +370,8 @@ transact (TALER_ARL_Analysis analysis,
int ret;
enum GNUNET_DB_QueryStatus qs;
- ret = TALER_AUDITORDB_start (TALER_ARL_adb);
+ ret = TALER_AUDITORDB_start (TALER_ARL_adb,
+ "auditor-analysis");
if (GNUNET_OK != ret)
{
GNUNET_break (0);
diff --git a/src/auditor/taler-helper-auditor-transfer.c b/src/auditor/taler-helper-auditor-transfer.c
@@ -367,7 +367,8 @@ begin_transaction (void)
return GNUNET_DB_STATUS_HARD_ERROR;
}
if (GNUNET_OK !=
- TALER_AUDITORDB_start (TALER_ARL_adb))
+ TALER_AUDITORDB_start (TALER_ARL_adb,
+ "auditor-transfer"))
{
GNUNET_break (0);
return GNUNET_DB_STATUS_HARD_ERROR;
diff --git a/src/auditor/taler-helper-auditor-wire-credit.c b/src/auditor/taler-helper-auditor-wire-credit.c
@@ -1166,7 +1166,8 @@ begin_transaction (void)
}
global_qs = GNUNET_DB_STATUS_SUCCESS_NO_RESULTS;
if (GNUNET_OK !=
- TALER_AUDITORDB_start (TALER_ARL_adb))
+ TALER_AUDITORDB_start (TALER_ARL_adb,
+ "auditor-wire-credit"))
{
GNUNET_break (0);
return GNUNET_DB_STATUS_HARD_ERROR;
diff --git a/src/auditor/taler-helper-auditor-wire-debit.c b/src/auditor/taler-helper-auditor-wire-debit.c
@@ -1649,7 +1649,8 @@ begin_transaction (void)
}
global_qs = GNUNET_DB_STATUS_SUCCESS_NO_RESULTS;
if (GNUNET_OK !=
- TALER_AUDITORDB_start (TALER_ARL_adb))
+ TALER_AUDITORDB_start (TALER_ARL_adb,
+ "auditor-wire-debit"))
{
GNUNET_break (0);
return GNUNET_DB_STATUS_HARD_ERROR;
diff --git a/src/auditordb/start.c b/src/auditordb/start.c
@@ -25,13 +25,15 @@
enum GNUNET_GenericReturnValue
-TALER_AUDITORDB_start (struct TALER_AUDITORDB_PostgresContext *pg)
+TALER_AUDITORDB_start (struct TALER_AUDITORDB_PostgresContext *pg,
+ const char *transaction_name)
{
struct GNUNET_PQ_ExecuteStatement es[] = {
GNUNET_PQ_make_execute ("START TRANSACTION ISOLATION LEVEL SERIALIZABLE"),
GNUNET_PQ_EXECUTE_STATEMENT_END
};
+ GNUNET_assert (NULL != transaction_name);
GNUNET_break (GNUNET_OK ==
TALER_AUDITORDB_preflight (pg));
if (GNUNET_OK !=
@@ -42,6 +44,7 @@ TALER_AUDITORDB_start (struct TALER_AUDITORDB_PostgresContext *pg)
GNUNET_break (0);
return GNUNET_SYSERR;
}
+ pg->transaction_name = transaction_name;
return GNUNET_OK;
}
diff --git a/src/auditordb/test_auditordb.c b/src/auditordb/test_auditordb.c
@@ -241,7 +241,8 @@ run (void *cls)
}
FAILIF (GNUNET_OK !=
- TALER_AUDITORDB_start (pg));
+ TALER_AUDITORDB_start (pg,
+ "test-auditordb"));
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"initializing\n");
diff --git a/src/auditordb/test_auditordb_checkpoints.c b/src/auditordb/test_auditordb_checkpoints.c
@@ -130,7 +130,8 @@ run (void *cls)
}
FAILIF (GNUNET_OK !=
- TALER_AUDITORDB_start (pg));
+ TALER_AUDITORDB_start (pg,
+ "test-auditordb-checkpoints"));
/* Test inserting a blank value, should tell us one result */
GNUNET_assert (
diff --git a/src/include/auditor-database/start.h b/src/include/auditor-database/start.h
@@ -30,10 +30,13 @@
* Start a transaction.
*
* @param pg the database context
+ * @param transaction_name unique name identifying the transaction (for debugging)
+ * must point to a constant
* @return #GNUNET_OK on success
*/
enum GNUNET_GenericReturnValue
-TALER_AUDITORDB_start (struct TALER_AUDITORDB_PostgresContext *pg);
+TALER_AUDITORDB_start (struct TALER_AUDITORDB_PostgresContext *pg,
+ const char *transaction_name);
/**