gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: corrections applied to batch tes


From: gnunet
Subject: [taler-exchange] branch master updated: corrections applied to batch test
Date: Thu, 05 Jan 2023 12:07:28 +0100

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

joseph-xu pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 7933815c corrections applied to batch test
7933815c is described below

commit 7933815ce6e6043aeb9e93e4a6ba472d74ddf89b
Author: Joseph <Joseph.xu@efrei.net>
AuthorDate: Thu Jan 5 06:07:20 2023 -0500

    corrections applied to batch test
---
 src/exchangedb/exchange_do_batch2_reserves_in_insert.sql |  4 ----
 src/exchangedb/exchange_do_batch4_reserves_in_insert.sql |  8 +-------
 src/exchangedb/exchange_do_batch8_reserves_in_insert.sql | 11 -----------
 src/exchangedb/exchange_do_batch_reserves_in_insert.sql  |  3 ---
 src/exchangedb/pg_batch2_reserves_in_insert.c            | 12 +++++-------
 5 files changed, 6 insertions(+), 32 deletions(-)

diff --git a/src/exchangedb/exchange_do_batch2_reserves_in_insert.sql 
b/src/exchangedb/exchange_do_batch2_reserves_in_insert.sql
index 2100f7de..f34a5bcf 100644
--- a/src/exchangedb/exchange_do_batch2_reserves_in_insert.sql
+++ b/src/exchangedb/exchange_do_batch2_reserves_in_insert.sql
@@ -122,10 +122,6 @@ BEGIN
     END IF;
   END IF;
   CLOSE curs_reserve_exist;
-  IF out_reserve_found AND out_reserve_found2
-  THEN
-      RETURN;
-  END IF;
 
   PERFORM pg_notify(in_notify, NULL);
   PERFORM pg_notify(in2_notify, NULL);
diff --git a/src/exchangedb/exchange_do_batch4_reserves_in_insert.sql 
b/src/exchangedb/exchange_do_batch4_reserves_in_insert.sql
index 15d8ef6f..ae7bee18 100644
--- a/src/exchangedb/exchange_do_batch4_reserves_in_insert.sql
+++ b/src/exchangedb/exchange_do_batch4_reserves_in_insert.sql
@@ -170,13 +170,7 @@ BEGIN
   k=k+1;
   END LOOP;
   CLOSE curs_reserve_exist;
-  IF out_reserve_found
-  AND out_reserve_found2
-  AND out_reserve_found3
-  AND out_reserve_found4
-  THEN
-      RETURN;
-  END IF;
+
 
   PERFORM pg_notify(in_notify, NULL);
   PERFORM pg_notify(in2_notify, NULL);
diff --git a/src/exchangedb/exchange_do_batch8_reserves_in_insert.sql 
b/src/exchangedb/exchange_do_batch8_reserves_in_insert.sql
index 6076f329..aa0322f4 100644
--- a/src/exchangedb/exchange_do_batch8_reserves_in_insert.sql
+++ b/src/exchangedb/exchange_do_batch8_reserves_in_insert.sql
@@ -289,17 +289,6 @@ BEGIN
   END LOOP;
 
   CLOSE curs_reserve_existed;
-  IF out_reserve_found
-  AND out_reserve_found2
-  AND out_reserve_found3
-  AND out_reserve_found4
-  AND out_reserve_found5
-  AND out_reserve_found6
-  AND out_reserve_found7
-  AND out_reserve_found8
-  THEN
-      RETURN;
-  END IF;
 
   PERFORM pg_notify(in_notify, NULL);
   PERFORM pg_notify(in2_notify, NULL);
diff --git a/src/exchangedb/exchange_do_batch_reserves_in_insert.sql 
b/src/exchangedb/exchange_do_batch_reserves_in_insert.sql
index 4ae7f68a..d86bd1ee 100644
--- a/src/exchangedb/exchange_do_batch_reserves_in_insert.sql
+++ b/src/exchangedb/exchange_do_batch_reserves_in_insert.sql
@@ -67,7 +67,6 @@ transaction_duplicate= TRUE;
   ELSE
     -- We made no change, which means the reserve existed.
     out_reserve_found = TRUE;
-    RETURN;
   END IF;
   PERFORM pg_notify(in_notify, NULL);
   INSERT INTO reserves_in
@@ -91,13 +90,11 @@ transaction_duplicate= TRUE;
   THEN
     -- HAPPY PATH THERE IS NO DUPLICATE TRANS
     transaction_duplicate = FALSE;
-    RETURN;
   ELSE
     -- Unhappy...
     RAISE EXCEPTION 'Reserve did not exist, but INSERT into reserves_in gave 
conflict';
     transaction_duplicate = TRUE;
     ROLLBACK;
-    RETURN;
   END IF;
   RETURN;
 END $$;
diff --git a/src/exchangedb/pg_batch2_reserves_in_insert.c 
b/src/exchangedb/pg_batch2_reserves_in_insert.c
index 62811f59..2b5c62f5 100644
--- a/src/exchangedb/pg_batch2_reserves_in_insert.c
+++ b/src/exchangedb/pg_batch2_reserves_in_insert.c
@@ -69,7 +69,7 @@ insert1(struct PostgresClosure *pg,
   PREPARE (pg,
            "batch1_reserve_create",
            "SELECT "
-           "out_reserve_found AS conflicted"
+           " out_reserve_found AS conflicted"
            ",transaction_duplicate"
            ",ruuid AS reserve_uuid"
            " FROM exchange_do_batch_reserves_in_insert"
@@ -103,7 +103,6 @@ insert1(struct PostgresClosure *pg,
     TALER_payto_hash (reserves[0].sender_account_details,
                       &h_payto);
 
-    /* Note: query uses 'on conflict do nothing' */
     qs2 = GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
                                                     "batch1_reserve_create",
                                                     params,
@@ -168,7 +167,7 @@ insert2 (struct PostgresClosure *pg,
       GNUNET_PQ_query_param_auto_from_type (&h_payto),
       GNUNET_PQ_query_param_string (reserves[0].sender_account_details),
       GNUNET_PQ_query_param_timestamp (&reserve_expiration),
-      GNUNET_PQ_query_param_string (notify_s[0]), // FIXME: 2 different 
notifies!
+      GNUNET_PQ_query_param_string (notify_s[0]),
       GNUNET_PQ_query_param_string (notify_s[1]),
 
       GNUNET_PQ_query_param_auto_from_type (reserves[1].reserve_pub),
@@ -210,7 +209,7 @@ insert2 (struct PostgresClosure *pg,
     if (qs1 < 0)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                  "Failed to create reserves (%d)\n",
+                  "Failed to create reserves 2(%d)\n",
                   qs1);
       results[0]=qs1;
       return qs1;
@@ -227,7 +226,7 @@ insert2 (struct PostgresClosure *pg,
         )
    {
      GNUNET_break (0);
-     TEH_PG_rollback (pg);
+     TEH_PG_rollback (pg); //ROLLBACK
      results[0] = GNUNET_DB_STATUS_HARD_ERROR;
      return GNUNET_DB_STATUS_HARD_ERROR;
    }
@@ -691,7 +690,6 @@ TEH_PG_batch2_reserves_in_insert (void *cls,
                                   reserves_length - i);
     if (bs >= 8)
     {
-      //     fprintf(stdout, "batch8");
       qs1=insert8(pg,
                   &reserves[i],
                   expiry,
@@ -707,7 +705,7 @@ TEH_PG_batch2_reserves_in_insert (void *cls,
      if (qs1<0)
       {
         GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                    "Failed to update reserves8 (%d)\n",
+                    "Failed to update reserves 8 (%d)\n",
                     qs1);
         return qs1;
       }

-- 
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]