|
8 | 8 | my $master = get_new_node("master"); |
9 | 9 | $master->init; |
10 | 10 | $master->append_conf('postgresql.conf', qq( |
11 | | - max_prepared_transactions = 10 |
| 11 | + max_prepared_transactions = 30 |
12 | 12 | log_checkpoints = true |
13 | 13 | postgres_fdw.use_tsdtm = on |
14 | 14 | )); |
|
17 | 17 | my $shard1 = get_new_node("shard1"); |
18 | 18 | $shard1->init; |
19 | 19 | $shard1->append_conf('postgresql.conf', qq( |
20 | | - max_prepared_transactions = 10 |
| 20 | + max_prepared_transactions = 300 |
21 | 21 | log_checkpoints = true |
22 | 22 | shared_preload_libraries = 'pg_tsdtm' |
23 | 23 | )); |
|
26 | 26 | my $shard2 = get_new_node("shard2"); |
27 | 27 | $shard2->init; |
28 | 28 | $shard2->append_conf('postgresql.conf', qq( |
29 | | - max_prepared_transactions = 10 |
| 29 | + max_prepared_transactions = 300 |
30 | 30 | log_checkpoints = true |
31 | 31 | shared_preload_libraries = 'pg_tsdtm' |
32 | 32 | )); |
|
52 | 52 | diag("done $host $port"); |
53 | 53 | } |
54 | 54 |
|
55 | | -$shard1->psql('postgres', "insert into accounts select 2*id-1, 0 from generate_series(1, 1000) as id;"); |
56 | | -$shard2->psql('postgres', "insert into accounts select 2*id, 0 from generate_series(1, 1000) as id;"); |
| 55 | +$shard1->psql('postgres', "insert into accounts select 2*id-1, 0 from generate_series(1, 10000) as id;"); |
| 56 | +$shard2->psql('postgres', "insert into accounts select 2*id, 0 from generate_series(1, 10000) as id;"); |
| 57 | + |
| 58 | +diag( $master->connstr() ); |
| 59 | +# sleep(3600); |
57 | 60 |
|
58 | 61 | ############################################################################### |
59 | 62 |
|
60 | 63 | my ($err, $rc); |
61 | 64 | my $seconds = 30; |
62 | | -my $total = 0; |
63 | | -my $oldtotal = 0; |
| 65 | +my $total = '0'; |
| 66 | +my $oldtotal = '0'; |
64 | 67 | my $isolation_error = 0; |
65 | 68 |
|
66 | | -my $pgb_handle = $master->pgbench_async(-n, -c => 1, -T => $seconds, -f => "$TestLib::log_path/../../t/bank.pgb", 'postgres' ); |
| 69 | + |
| 70 | +$master->pgbench(-n, -c => 5, -t => 10, -f => "$TestLib::log_path/../../t/bank.pgb", 'postgres' ); |
| 71 | + |
| 72 | +my $pgb_handle = $master->pgbench_async(-n, -c => 5, -T => $seconds, -f => "$TestLib::log_path/../../t/bank.pgb", 'postgres' ); |
67 | 73 |
|
68 | 74 | my $started = time(); |
69 | 75 | while (time() - $started < $seconds) |
70 | 76 | { |
71 | 77 | ($rc, $total, $err) = $master->psql('postgres', "select sum(amount) from accounts"); |
72 | | - if ($oldtotal != $total) |
| 78 | + if ( ($total ne $oldtotal) and ($total ne '') ) |
73 | 79 | { |
74 | 80 | $isolation_error = 1; |
75 | 81 | $oldtotal = $total; |
|
0 commit comments