diff --git a/src/exchangedb/exchange_do_batch2_reserves_in_insert.sql b/src/exchangedb/exchange_do_batch2_reserves_in_insert.sql index f34a5bcfa..d1cc10415 100644 --- a/src/exchangedb/exchange_do_batch2_reserves_in_insert.sql +++ b/src/exchangedb/exchange_do_batch2_reserves_in_insert.sql @@ -178,13 +178,13 @@ BEGIN END IF; END IF; END IF; - IF transaction_duplicate +/* IF transaction_duplicate OR transaction_duplicate2 THEN CLOSE curs_transaction_exist; ROLLBACK; RETURN; - END IF; + END IF;*/ CLOSE curs_transaction_exist; RETURN; END $$; diff --git a/src/exchangedb/exchange_do_batch4_reserves_in_insert.sql b/src/exchangedb/exchange_do_batch4_reserves_in_insert.sql index ae7bee18f..1817e695a 100644 --- a/src/exchangedb/exchange_do_batch4_reserves_in_insert.sql +++ b/src/exchangedb/exchange_do_batch4_reserves_in_insert.sql @@ -244,7 +244,7 @@ BEGIN k=k+1; END LOOP; - IF transaction_duplicate + /*IF transaction_duplicate OR transaction_duplicate2 OR transaction_duplicate3 OR transaction_duplicate4 @@ -253,7 +253,7 @@ BEGIN ROLLBACK; CLOSE curs_transaction_exist; RETURN; - END IF; + END IF;*/ CLOSE curs_transaction_exist; RETURN; diff --git a/src/exchangedb/exchange_do_batch8_reserves_in_insert.sql b/src/exchangedb/exchange_do_batch8_reserves_in_insert.sql index aa0322f44..997a7b3e2 100644 --- a/src/exchangedb/exchange_do_batch8_reserves_in_insert.sql +++ b/src/exchangedb/exchange_do_batch8_reserves_in_insert.sql @@ -238,7 +238,6 @@ BEGIN RETURNING reserve_uuid,reserve_pub) SELECT * FROM reserve_changes; - WHILE k < 8 LOOP FETCH FROM curs_reserve_existed INTO i; @@ -410,7 +409,7 @@ BEGIN END IF; k=k+1; END LOOP; - IF transaction_duplicate + /* IF transaction_duplicate OR transaction_duplicate2 OR transaction_duplicate3 OR transaction_duplicate4 @@ -422,7 +421,7 @@ BEGIN CLOSE curs_transaction_existed; ROLLBACK; RETURN; - END IF; + END IF;*/ CLOSE curs_transaction_existed; RETURN; END $$; diff --git a/src/exchangedb/pg_batch2_reserves_in_insert.c b/src/exchangedb/pg_batch2_reserves_in_insert.c index 2b5c62f5e..a1fc7d5a4 100644 --- a/src/exchangedb/pg_batch2_reserves_in_insert.c +++ b/src/exchangedb/pg_batch2_reserves_in_insert.c @@ -116,7 +116,7 @@ insert1(struct PostgresClosure *pg, return qs2; } GNUNET_assert (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != qs2); - if ((conflict[0]) && transaction_duplicate[0]) + if ((! conflict[0]) && transaction_duplicate[0]) { GNUNET_break (0); TEH_PG_rollback (pg); @@ -221,8 +221,8 @@ insert2 (struct PostgresClosure *pg, : GNUNET_DB_STATUS_SUCCESS_ONE_RESULT;*/ if ( - ((conflict[0]) && (transaction_duplicate[0])) - ||((conflict[1]) && (transaction_duplicate[1])) + ((! conflict[0]) && (transaction_duplicate[0])) + ||((! conflict[1]) && (transaction_duplicate[1])) ) { GNUNET_break (0); @@ -366,10 +366,10 @@ insert4 (struct PostgresClosure *pg, GNUNET_assert (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != qs3); if ( - ((conflict[0]) && (transaction_duplicate[0])) - ||((conflict[1]) && (transaction_duplicate[1])) - ||((conflict[2]) && (transaction_duplicate[2])) - ||((conflict[3]) && (transaction_duplicate[3])) + ((! conflict[0]) && (transaction_duplicate[0])) + ||((! conflict[1]) && (transaction_duplicate[1])) + ||((! conflict[2]) && (transaction_duplicate[2])) + ||((! conflict[3]) && (transaction_duplicate[3])) ) { GNUNET_break (0); @@ -600,14 +600,14 @@ insert8 (struct PostgresClosure *pg, : GNUNET_DB_STATUS_SUCCESS_ONE_RESULT;*/ if ( - ((conflict[0]) && (transaction_duplicate[0])) - ||((conflict[1]) && (transaction_duplicate[1])) - ||((conflict[2]) && (transaction_duplicate[2])) - ||((conflict[3]) && (transaction_duplicate[3])) - ||((conflict[4]) && (transaction_duplicate[4])) - ||((conflict[5]) && (transaction_duplicate[5])) - ||((conflict[6]) && (transaction_duplicate[6])) - ||((conflict[7]) && (transaction_duplicate[7])) + ((! conflict[0]) && (transaction_duplicate[0])) + ||((! conflict[1]) && (transaction_duplicate[1])) + ||((! conflict[2]) && (transaction_duplicate[2])) + ||((! conflict[3]) && (transaction_duplicate[3])) + ||((! conflict[4]) && (transaction_duplicate[4])) + ||((! conflict[5]) && (transaction_duplicate[5])) + ||((! conflict[6]) && (transaction_duplicate[6])) + ||((! conflict[7]) && (transaction_duplicate[7])) ) { GNUNET_break (0); @@ -710,6 +710,7 @@ TEH_PG_batch2_reserves_in_insert (void *cls, return qs1; } // fprintf(stdout, "%ld %ld %ld %ld %ld %ld %ld %ld\n", reserve_uuid[i], reserve_uuid[i+1], reserve_uuid[i+2], reserve_uuid[i+3], reserve_uuid[i+4], reserve_uuid[i+5], reserve_uuid[i+6],reserve_uuid[]); + // fprintf(stdout, "%d %d %d %d %d %d %d %d\n", conflicts[i], conflicts[i+1], conflicts[i+2], conflicts[i+3], conflicts[i+4], conflicts[i+5], conflicts[i+6],conflicts[]); need_update |= conflicts[i]; need_update |= conflicts[i+1]; need_update |= conflicts[i+2]; @@ -790,7 +791,7 @@ TEH_PG_batch2_reserves_in_insert (void *cls, need_update |= conflicts[i+1]; t_duplicate |= transaction_duplicate[i]; t_duplicate |= transaction_duplicate[i+1]; - + // fprintf(stdout, "t : %d %d", transaction_duplicate[i], transaction_duplicate[i+1]); i += 2; break; case 1: diff --git a/src/exchangedb/test_exchangedb_by_j.c b/src/exchangedb/test_exchangedb_by_j.c index 9769d964b..0e42fbe78 100644 --- a/src/exchangedb/test_exchangedb_by_j.c +++ b/src/exchangedb/test_exchangedb_by_j.c @@ -107,7 +107,7 @@ run (void *cls) const char *sndr = "payto://x-taler-bank/localhost:8080/1"; struct TALER_Amount value; unsigned int batch_size = batches[i]; - unsigned int iterations = 16;//1024*10; + unsigned int iterations = 200;//1024*10; struct TALER_ReservePublicKeyP reserve_pubs[iterations]; struct GNUNET_TIME_Absolute now; struct GNUNET_TIME_Timestamp ts;