@@ -7,7 +7,7 @@ reinit_master() {
7
7
8
8
echo " max_prepared_transactions = 100" >> ./install/data/postgresql.conf
9
9
echo " shared_buffers = 512MB" >> ./install/data/postgresql.conf
10
- echo " fsync = off " >> ./install/data/postgresql.conf
10
+ # echo "fsync = on " >> ./install/data/postgresql.conf
11
11
echo " log_checkpoints = on" >> ./install/data/postgresql.conf
12
12
echo " max_wal_size = 48MB" >> ./install/data/postgresql.conf
13
13
echo " min_wal_size = 32MB" >> ./install/data/postgresql.conf
@@ -16,11 +16,11 @@ reinit_master() {
16
16
echo " max_wal_senders = 2" >> ./install/data/postgresql.conf
17
17
echo " max_replication_slots = 2" >> ./install/data/postgresql.conf
18
18
19
- echo ' ' > ./install/data /logfile
19
+ echo ' ---- test ---- ' >> ./install/logfile
20
20
21
21
echo ' local replication stas trust' >> ./install/data/pg_hba.conf
22
22
23
- ./install/bin/pg_ctl -sw -D ./install/data -l ./install/data/ logfile start
23
+ ./install/bin/pg_ctl -sw -D ./install/data -l ./install/logfile start
24
24
./install/bin/createdb stas
25
25
./install/bin/psql -c " create table t(id int);"
26
26
}
@@ -33,12 +33,14 @@ reinit_slave() {
33
33
echo " port = 5433" >> ./install/data_slave/postgresql.conf
34
34
echo " hot_standby = on" >> ./install/data_slave/postgresql.conf
35
35
36
- echo ' ' > ./install/data_slave/logfile
36
+ echo ' ---- test ---- ' >> ./install/slave_logfile
37
37
38
- ./install/bin/pg_ctl -sw -D ./install/data_slave -l ./install/data_slave/logfile start
38
+ ./install/bin/pg_ctl -sw -D ./install/data_slave -l ./install/slave_logfile start
39
39
}
40
40
41
41
make install > /dev/null
42
+ echo > ./install/logfile
43
+ echo > ./install/slave_logfile
42
44
43
45
44
46
cat << MSG
@@ -59,7 +61,7 @@ psql <<SQL
59
61
insert into t values (43);
60
62
prepare transaction 'y';
61
63
SQL
62
- ./install/bin/pg_ctl -sw -D ./install/data -l ./install/data/ logfile restart
64
+ ./install/bin/pg_ctl -sw -D ./install/data -l ./install/logfile restart
63
65
psql << SQL
64
66
commit prepared 'x';
65
67
rollback prepared 'y';
78
80
pkill -9 postgres
79
81
reinit_master >> /dev/null
80
82
psql << SQL
83
+ checkpoint;
84
+ select * from pg_current_xlog_location();
81
85
begin;
82
86
insert into t values (42);
83
87
prepare transaction 'x';
88
+ select * from pg_current_xlog_location();
84
89
begin;
85
90
insert into t values (43);
86
91
prepare transaction 'y';
87
92
SQL
88
93
pkill -9 postgres
89
- ./install/bin/pg_ctl -sw -D ./install/data -l ./install/data/logfile start
94
+ echo ' --- kill -9 ---' >> ./install/logfile
95
+ ./install/bin/pg_ctl -sw -D ./install/data -l ./install/logfile start
90
96
psql << SQL
91
97
commit prepared 'x';
92
98
rollback prepared 'y';
@@ -105,11 +111,13 @@ reinit_master >> /dev/null
105
111
psql << SQL
106
112
begin;
107
113
insert into t values (42);
114
+ savepoint s;
115
+ insert into t values (43);
108
116
prepare transaction 'x';
109
117
commit prepared 'x';
110
118
SQL
111
119
pkill -9 postgres
112
- ./install/bin/pg_ctl -sw -D ./install/data -l ./install/data/ logfile start
120
+ ./install/bin/pg_ctl -sw -D ./install/data -l ./install/logfile start
113
121
psql << SQL
114
122
begin;
115
123
insert into t values (42);
@@ -206,8 +214,8 @@ psql <<SQL
206
214
prepare transaction 'x';
207
215
insert into t values (100);
208
216
SQL
209
- ./install/bin/pg_ctl -sw -D ./install/data -l ./install/data/ logfile stop
210
- ./install/bin/pg_ctl -sw -D ./install/data_slave -l ./install/data_slave/logfile restart
217
+ ./install/bin/pg_ctl -sw -D ./install/data -l ./install/logfile stop
218
+ ./install/bin/pg_ctl -sw -D ./install/data_slave -l ./install/slave_logfile restart
211
219
echo " Following list should contain transaction 'x':"
212
220
psql -p5433 << SQL
213
221
select * from pg_prepared_xacts;
@@ -232,9 +240,9 @@ psql <<SQL
232
240
prepare transaction 'x';
233
241
insert into t values (100);
234
242
SQL
235
- ./install/bin/pg_ctl -sw -D ./install/data -l ./install/data/ logfile stop
243
+ ./install/bin/pg_ctl -sw -D ./install/data -l ./install/logfile stop
236
244
kill -9 ` cat install/data_slave/postmaster.pid | head -n 1`
237
- ./install/bin/pg_ctl -sw -D ./install/data_slave -l ./install/data_slave/logfile start
245
+ ./install/bin/pg_ctl -sw -D ./install/data_slave -l ./install/slave_logfile start
238
246
echo " Following list should contain transaction 'x':"
239
247
psql -p5433 << SQL
240
248
select * from pg_prepared_xacts;
@@ -259,9 +267,21 @@ psql <<SQL
259
267
prepare transaction 'x';
260
268
SQL
261
269
pkill -9 postgres
262
- ./install/bin/pg_ctl -sw -D ./install/data -l ./install/data/ logfile start
270
+ ./install/bin/pg_ctl -sw -D ./install/data -l ./install/logfile start
263
271
psql << SQL
264
272
commit prepared 'x';
265
273
SQL
266
274
267
275
276
+
277
+ # check for prescan with pgbench
278
+
279
+
280
+
281
+
282
+
283
+
284
+
285
+
286
+
287
+
0 commit comments