gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: -experimental wirewatch change t


From: gnunet
Subject: [taler-exchange] branch master updated: -experimental wirewatch change to keep shard locks across history requests
Date: Sat, 21 May 2022 02:00:33 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new a6494f99 -experimental wirewatch change to keep shard locks across 
history requests
a6494f99 is described below

commit a6494f9905f88245a4dbb6830dfd531c0badf17e
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat May 21 02:00:31 2022 +0200

    -experimental wirewatch change to keep shard locks across history requests
---
 src/exchange/taler-exchange-wirewatch.c | 35 ++++++++++++++++++++++++++-------
 1 file changed, 28 insertions(+), 7 deletions(-)

diff --git a/src/exchange/taler-exchange-wirewatch.c 
b/src/exchange/taler-exchange-wirewatch.c
index 24f92efa..898d678a 100644
--- a/src/exchange/taler-exchange-wirewatch.c
+++ b/src/exchange/taler-exchange-wirewatch.c
@@ -480,6 +480,16 @@ mark_shard_done (struct WireAccount *wa)
 }
 
 
+/**
+ * Continue with the credit history of the shard
+ * reserved as @a wa_pos.
+ *
+ * @param[in,out] wa_pos shard to continue processing
+ */
+static void
+continue_with_shard (struct WireAccount *wa_pos);
+
+
 /**
  * We are finished with the current transaction, try
  * to commit and then schedule the next iteration.
@@ -490,9 +500,10 @@ static void
 do_commit (struct WireAccount *wa)
 {
   enum GNUNET_DB_QueryStatus qs;
+  bool shard_done;
 
   wa->started_transaction = false;
-  mark_shard_done (wa);
+  shard_done = mark_shard_done (wa);
   qs = db_plugin->commit (db_plugin->cls);
   switch (qs)
   {
@@ -509,7 +520,10 @@ do_commit (struct WireAccount *wa)
     /* normal case */
     break;
   }
-  shard_completed (wa);
+  if (shard_done)
+    shard_completed (wa);
+  else
+    continue_with_shard (wa);
 }
 
 
@@ -681,7 +695,6 @@ static void
 find_transfers (void *cls)
 {
   enum GNUNET_DB_QueryStatus qs;
-  unsigned int limit;
 
   (void) cls;
   task = NULL;
@@ -761,15 +774,23 @@ find_transfers (void *cls)
       break;
     }
   }
+  wa_pos->latest_row_off = wa_pos->batch_start;
+  continue_with_shard (wa_pos);
+}
+
+
+static void
+continue_with_shard (struct WireAccount *wa_pos)
+{
+  unsigned int limit;
 
   limit = GNUNET_MIN (wa_pos->batch_size,
-                      wa_pos->shard_end - wa_pos->batch_start);
+                      wa_pos->shard_end - wa_pos->latest_row_off);
   GNUNET_assert (NULL == wa_pos->hh);
-  wa_pos->latest_row_off = wa_pos->batch_start;
-  wa_pos->max_row_off = wa_pos->batch_start + limit - 1;
+  wa_pos->max_row_off = wa_pos->latest_row_off + limit - 1;
   wa_pos->hh = TALER_BANK_credit_history (ctx,
                                           wa_pos->ai->auth,
-                                          wa_pos->batch_start,
+                                          wa_pos->latest_row_off,
                                           limit,
                                           test_mode
                                           ? GNUNET_TIME_UNIT_ZERO

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]