@@ -39,7 +39,6 @@ func (t TransfersTS) prepare_one(connstr string, wg *sync.WaitGroup) {
39
39
exec (conn , "insert into t (select generate_series(0,$1-1), $2)" ,
40
40
cfg .AccountsNum , 0 )
41
41
42
- exec (conn , "commit" )
43
42
wg .Done ()
44
43
}
45
44
@@ -68,14 +67,18 @@ func (t TransfersTS) writer(id int, cCommits chan int, cAborts chan int, wg *syn
68
67
69
68
gtid := strconv .Itoa (id ) + "." + strconv .Itoa (i )
70
69
amount := 2 * rand .Intn (2 ) - 1
71
- from_acc := cfg .Writers .StartId + 2 * id + 1
72
- to_acc := cfg .Writers .StartId + 2 * id + 2
70
+ //from_acc := cfg.Writers.StartId + 2*id + 1
71
+ //to_acc := cfg.Writers.StartId + 2*id + 2
72
+ from_acc := rand .Intn (cfg .AccountsNum ) //cfg.Writers.StartId + 2*id + 1
73
+ to_acc := rand .Intn (cfg .AccountsNum ) //cfg.Writers.StartId + 2*id + 2
73
74
74
75
conn1 := conns [rand .Intn (len (conns ))]
75
76
conn2 := conns [rand .Intn (len (conns ))]
76
- if conn1 == conn2 {
77
- continue
78
- }
77
+
78
+ for conn1 == conn2 {
79
+ conn1 = conns [rand .Intn (len (conns ))]
80
+ conn2 = conns [rand .Intn (len (conns ))]
81
+ }
79
82
80
83
exec (conn1 , "begin transaction" )
81
84
exec (conn2 , "begin transaction" )
@@ -134,9 +137,6 @@ func (t TransfersTS) reader(wg *sync.WaitGroup, cFetches chan int, inconsistency
134
137
snapshot = _execQuery (conn , "select dtm_access($1)" , snapshot )
135
138
}
136
139
}
137
-
138
- exec (conn , "begin transaction isolation level " + cfg .Isolation )
139
- sum += _execQuery (conn , "select sum(v) from t" )
140
140
}
141
141
142
142
for _ , conn := range conns {
0 commit comments