Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7e25ccd

Browse files
committed
Actually use the 'private rows' parameter in transfers test.
1 parent57f620d commit7e25ccd

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

‎contrib/pg_dtm/tests/transfers.go‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,11 +275,20 @@ func writer(id int, cCommits chan int, cAborts chan int, wg *sync.WaitGroup) {
275275
start:=time.Now()
276276
formyCommits<cfg.Writers.Updates {
277277
amount:=1
278+
278279
from_acc:=rand.Intn(cfg.Accounts.Num)
279280
to_acc:=rand.Intn(cfg.Accounts.Num)
280281

281-
if (from_acc==to_acc) {
282-
to_acc= (from_acc+1)%cfg.Accounts.Num
282+
ifcfg.Writers.PrivateRows {
283+
from_acc+=id- (from_acc%cfg.Writers.Num)
284+
to_acc+=id- (to_acc%cfg.Writers.Num)
285+
if (from_acc==to_acc) {
286+
to_acc= (from_acc+cfg.Writers.Num)%cfg.Accounts.Num
287+
}
288+
}else {
289+
if (from_acc==to_acc) {
290+
to_acc= (from_acc+1)%cfg.Accounts.Num
291+
}
283292
}
284293

285294
if (from_acc>to_acc) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp