File tree Expand file tree Collapse file tree 3 files changed +16
-26
lines changed Expand file tree Collapse file tree 3 files changed +16
-26
lines changed Original file line number Diff line number Diff line change @@ -196,25 +196,19 @@ static void gen_snapshot(Snapshot *s) {
196
196
int n = 0 ;
197
197
s -> times_sent = 0 ;
198
198
for (t = (Transaction * )active_transactions .prev ; t != (Transaction * )& active_transactions ; t = (Transaction * )t -> elem .prev ) {
199
- /*
200
- if (t->xid < s->xmin) {
201
- s->xmin = t->xid;
202
- }
203
- if (t->xid >= s->xmax) {
204
- s->xmax = t->xid + 1;
205
- }
206
- */
207
199
s -> active [n ++ ] = t -> xid ;
208
200
}
209
- s -> nactive = n ;
201
+ while (n > 1 && s -> active [n - 2 ]+ 1 == s -> active [n - 1 ]) {
202
+ n -= 1 ;
203
+ }
210
204
if (n > 0 ) {
211
205
s -> xmin = s -> active [0 ];
212
- s -> xmax = s -> active [n - 1 ];
206
+ s -> xmax = s -> active [-- n ];
213
207
assert (s -> xmin <= s -> xmax );
214
- // snapshot_sort(s);
215
208
} else {
216
209
s -> xmin = s -> xmax = 0 ;
217
210
}
211
+ s -> nactive = n ;
218
212
}
219
213
220
214
static void onreserve (client_t client , int argc , xid_t * argv ) {
Original file line number Diff line number Diff line change 547
547
# These settings are initialized by initdb, but they can be changed.
548
548
lc_messages = ' en_US.UTF-8' # locale for system error message
549
549
# strings
550
- lc_monetary = ' ru_RU .UTF-8' # locale for monetary formatting
551
- lc_numeric = ' ru_RU .UTF-8' # locale for number formatting
552
- lc_time = ' ru_RU .UTF-8' # locale for time formatting
550
+ lc_monetary = ' en_US .UTF-8' # locale for monetary formatting
551
+ lc_numeric = ' en_US .UTF-8' # locale for number formatting
552
+ lc_time = ' en_US .UTF-8' # locale for time formatting
553
553
554
554
# default configuration for text search
555
555
default_text_search_config = ' pg_catalog.english'
624
624
625
625
# Add settings for extensions here
626
626
627
- multimaster.queue_size = 1073741824
628
- # multimaster.workers = 16
627
+ multimaster.workers= 8
628
+ multimaster.queue_size= 1073741824
Original file line number Diff line number Diff line change 1
1
n_nodes=3
2
- export PATH=/home/knizhnik/postgrespro/cluster_install /bin/:$PATH
2
+ export PATH=/home/knizhnik/postgres_cluster/dist /bin/:$PATH
3
3
ulimit -c unlimited
4
4
pkill -9 postgres
5
5
pkill -9 dtmd
6
- sleep 2
7
- rm -fr node ? * .log dtm/ *
6
+ rm -fr node ? * .log dtm
7
+ mkdir dtm
8
8
conn_str=" "
9
9
sep=" "
10
10
for (( i= 1 ;i<= n_nodes;i++ ))
11
11
do
12
12
port=$(( 5431 + i))
13
- conn_str=" $conn_str ${sep} replication=database dbname=postgres host=127.0.0.1 user=knizhnik port=$port sslmode=disable"
13
+ conn_str=" $conn_str ${sep} dbname=postgres host=127.0.0.1 user=knizhnik port=$port sslmode=disable"
14
14
sep=" ,"
15
15
initdb node$i
16
16
done
17
17
18
18
echo Start DTM
19
- ~ /postgrespro /contrib/multimaster/dtmd/bin/dtmd -d dtm 2> dtm.log &
19
+ ~ /postgres_cluster /contrib/multimaster/dtmd/bin/dtmd -d dtm 2> dtm.log &
20
20
sleep 2
21
21
22
22
echo Start nodes
32
32
33
33
sleep 5
34
34
echo Initialize database schema
35
- for (( i= 1 ;i<= n_nodes;i++ ))
36
- do
37
- port=$(( 5431 + i))
38
- psql -p $port postgres -U knizhnik -f init.sql
39
- done
35
+ psql postgres -U knizhnik -f init.sql
40
36
41
37
echo Done
You can’t perform that action at this time.
0 commit comments