|
1 | 1 | use strict;
|
2 | 2 | use warnings;
|
| 3 | +use File::Basename; |
| 4 | +use File::Spec::Functions 'catfile'; |
3 | 5 |
|
4 | 6 | use PostgresNode;
|
5 | 7 | use TestLib;
|
|
10 | 12 | $master->append_conf('postgresql.conf', qq(
|
11 | 13 | max_prepared_transactions = 30
|
12 | 14 | log_checkpoints = true
|
13 |
| - # postgres_fdw.use_global_snapshots = on |
| 15 | + postgres_fdw.use_global_snapshots = on |
14 | 16 | ));
|
15 | 17 | $master->start;
|
16 | 18 |
|
|
19 | 21 | $shard1->append_conf('postgresql.conf', qq(
|
20 | 22 | max_prepared_transactions = 30
|
21 | 23 | log_checkpoints = true
|
22 |
| - # shared_preload_libraries = 'pg_tsdtm' |
23 | 24 | ));
|
24 | 25 | $shard1->start;
|
25 | 26 |
|
|
28 | 29 | $shard2->append_conf('postgresql.conf', qq(
|
29 | 30 | max_prepared_transactions = 30
|
30 | 31 | log_checkpoints = true
|
31 |
| - # shared_preload_libraries = 'pg_tsdtm' |
32 | 32 | ));
|
33 | 33 | $shard2->start;
|
34 | 34 |
|
|
47 | 47 |
|
48 | 48 | $master->psql('postgres', "CREATE SERVER shard_$port FOREIGN DATA WRAPPER postgres_fdw options(dbname 'postgres', host '$host', port '$port')");
|
49 | 49 | $master->psql('postgres', "CREATE FOREIGN TABLE accounts_fdw_$port() inherits (accounts) server shard_$port options(table_name 'accounts')");
|
50 |
| - $master->psql('postgres', "CREATE USER MAPPING for stas SERVER shard_$port options (user 'stas')"); |
| 50 | + my $me = scalar(getpwuid($<)); |
| 51 | + $master->psql('postgres', "CREATE USER MAPPING for $me SERVER shard_$port options (user '$me')"); |
51 | 52 |
|
52 | 53 | # diag("done $host $port");
|
53 | 54 | }
|
|
66 | 67 | my $oldtotal = '0';
|
67 | 68 | my $isolation_error = 0;
|
68 | 69 |
|
| 70 | +my $pgb_path = catfile(dirname(__FILE__), "bank.pgb"); |
| 71 | +$master->pgbench(-n, -c => 5, -t => 10, -f => "$pgb_path", 'postgres' ); |
69 | 72 |
|
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' ); |
| 73 | +my $pgb_handle = $master->pgbench_async(-n, -c => 5, -T => $seconds, -f => "$pgb_path", 'postgres' ); |
73 | 74 |
|
74 | 75 | my $started = time();
|
75 | 76 | while (time() - $started < $seconds)
|
|
0 commit comments