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) {
196196 int n = 0 ;
197197 s -> times_sent = 0 ;
198198 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- */
207199 s -> active [n ++ ] = t -> xid ;
208200 }
209- s -> nactive = n ;
201+ while (n > 1 && s -> active [n - 2 ]+ 1 == s -> active [n - 1 ]) {
202+ n -= 1 ;
203+ }
210204 if (n > 0 ) {
211205 s -> xmin = s -> active [0 ];
212- s -> xmax = s -> active [n - 1 ];
206+ s -> xmax = s -> active [-- n ];
213207 assert (s -> xmin <= s -> xmax );
214- // snapshot_sort(s);
215208 } else {
216209 s -> xmin = s -> xmax = 0 ;
217210 }
211+ s -> nactive = n ;
218212}
219213
220214static void onreserve (client_t client , int argc , xid_t * argv ) {
Original file line number Diff line number Diff line change 547547# These settings are initialized by initdb, but they can be changed.
548548lc_messages = ' en_US.UTF-8' # locale for system error message
549549 # 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
553553
554554# default configuration for text search
555555default_text_search_config = ' pg_catalog.english'
624624
625625# Add settings for extensions here
626626
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 11n_nodes=3
2- export PATH=/home/knizhnik/postgrespro/cluster_install /bin/:$PATH
2+ export PATH=/home/knizhnik/postgres_cluster/dist /bin/:$PATH
33ulimit -c unlimited
44pkill -9 postgres
55pkill -9 dtmd
6- sleep 2
7- rm -fr node ? * .log dtm/ *
6+ rm -fr node ? * .log dtm
7+ mkdir dtm
88conn_str=" "
99sep=" "
1010for (( i= 1 ;i<= n_nodes;i++ ))
1111do
1212 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"
1414 sep=" ,"
1515 initdb node$i
1616done
1717
1818echo 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 &
2020sleep 2
2121
2222echo Start nodes
3232
3333sleep 5
3434echo 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
4036
4137echo Done
You can’t perform that action at this time.
0 commit comments