|
7 | 7 | use warnings;
|
8 | 8 | use PostgresNode;
|
9 | 9 | use TestLib;
|
10 |
| -use Test::More tests => 11; |
| 10 | +use Test::More tests => 10; |
11 | 11 | use Config;
|
12 | 12 |
|
13 | 13 | # Initialize master node
|
|
135 | 135 | is($node_master->slot('otherdb_slot')->{'slot_name'},
|
136 | 136 | undef, 'logical slot was actually dropped with DB');
|
137 | 137 |
|
138 |
| -# Test to ensure that we don't run out of file descriptors even if there |
139 |
| -# are more spill files than maxAllocatedDescs. |
140 |
| - |
141 |
| -# Set max_files_per_process to a small value to make it more likely to run out |
142 |
| -# of max open file descriptors. |
143 |
| -$node_master->safe_psql('postgres', |
144 |
| - 'ALTER SYSTEM SET max_files_per_process = 26;'); |
145 |
| -$node_master->restart; |
146 |
| - |
147 |
| -$node_master->safe_psql( |
148 |
| - 'postgres', q{ |
149 |
| -do $$ |
150 |
| -BEGIN |
151 |
| - FOR i IN 1..10 LOOP |
152 |
| - BEGIN |
153 |
| - INSERT INTO decoding_test(x) SELECT generate_series(1,5000); |
154 |
| - EXCEPTION |
155 |
| - when division_by_zero then perform 'dummy'; |
156 |
| - END; |
157 |
| - END LOOP; |
158 |
| -END $$; |
159 |
| -}); |
160 |
| - |
161 |
| -$result = $node_master->safe_psql('postgres', |
162 |
| - qq[ |
163 |
| -set logical_decoding_work_mem to 64; -- generate plenty of .spill files |
164 |
| -SELECT data from pg_logical_slot_get_changes('test_slot', NULL, NULL) |
165 |
| - WHERE data LIKE '%INSERT%' ORDER BY lsn LIMIT 1; |
166 |
| -]); |
167 |
| - |
168 |
| -$expected = q{table public.decoding_test: INSERT: x[integer]:1 y[text]:null}; |
169 |
| -is($result, $expected, 'got expected output from spilling subxacts session'); |
170 |
| - |
171 |
| -# Reset back max_files_per_process |
172 |
| -$node_master->safe_psql('postgres', |
173 |
| - 'ALTER SYSTEM SET max_files_per_process = DEFAULT;'); |
174 |
| -$node_master->restart; |
175 |
| - |
176 | 138 | # done with the node
|
177 | 139 | $node_master->stop;
|
0 commit comments