Skip to content

Commit d6d7bba

Browse files
committed
Merge branch 'xtm' of gitlab.postgrespro.ru:pgpro-dev/postgrespro into xtm
2 parents 74cf8ee + 1960984 commit d6d7bba

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

contrib/pg_dtm/tests/pg_shard_transfers.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
_ "github.com/jgallagher/go-libpq"
77
"database/sql"
88
"strconv"
9+
"math/rand"
910
)
1011

1112
const (
@@ -60,8 +61,8 @@ func transfer(id int, wg *sync.WaitGroup) {
6061

6162
for i:=0; i < N_ITERATIONS; i++ {
6263
exec(conn, "begin")
63-
exec(conn, "update t set v = v + 1 where u="+strconv.Itoa(uids1[id]))
64-
exec(conn, "update t set v = v - 1 where u="+strconv.Itoa(uids2[id]))
64+
exec(conn, "update t set v = v + 1 where u="+strconv.Itoa(uids1[rand.Intn(TRANSFER_CONNECTIONS)]))
65+
exec(conn, "update t set v = v - 1 where u="+strconv.Itoa(uids2[rand.Intn(TRANSFER_CONNECTIONS)]))
6566
// exec(conn, "update t set v = v + 1 where u=1")
6667
// exec(conn, "update t set v = v - 1 where u=2")
6768
exec(conn, "commit")

contrib/pg_dtm/tests/transfers.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ const (
1212
TRANSFER_CONNECTIONS = 8
1313
INIT_AMOUNT = 10000
1414
N_ITERATIONS = 10000
15-
N_ACCOUNTS = TRANSFER_CONNECTIONS//100000
16-
ISOLATION_LEVEL = "repeatable read"
17-
//ISOLATION_LEVEL = "read committed"
15+
N_ACCOUNTS = 100000
16+
//ISOLATION_LEVEL = "repeatable read"
17+
ISOLATION_LEVEL = "read committed"
1818
)
1919

2020

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy