137137spockbench -h /tmp -i -s $SCALEFACTOR $PGDATABASE
138138
139139psql -h /tmp << _EOF_
140- -- SET spock.enable_ddl_replication = 'on';
141- -- SET spock.include_ddl_repset = 'on';
142-
143140 /*
144141 * To use delta_apply we should add NOT NULL constraint on such a column first.
145142 * Do it on each node - remember, we don't have Auto-DDL enabled.
@@ -153,11 +150,6 @@ psql -h /tmp <<_EOF_
153150 * propagated by LR to other nodes
154151 */
155152 SELECT spock.repset_add_all_tables('default', '{public}');
156-
157-
158- -- SELECT spock.delta_apply('pgbench_accounts', 'abalance', false);
159- -- SELECT spock.delta_apply('pgbench_branches', 'bbalance', false);
160- -- SELECT spock.delta_apply('pgbench_tellers', 'tbalance', false);
161153_EOF_
162154
163155# ==========Spockbench tests ==========
@@ -168,6 +160,21 @@ spockbench -h /tmp --spock-num-nodes=3 --spock-node=${HOSTNAME:0-1} \
168160 -s $SCALEFACTOR -T $RUNTIME -R $RATE -P 5 -j $THREADS -c $CONNECTIONS \
169161 -n --spock-tx-mix=550,225,225 $PGDATABASE
170162
163+ # To be sure each spockbench client finalised their job
164+ # There are still races possible. Should it be OK for our testing purposes?
165+ sleep 5
166+
167+ # To be sure that conflict resolution has happened we need to wait until the
168+ # following transaction arrives
169+ echo " Begin after-Spockbench sync"
170+ for peer in " ${peer_names[@]} " ; do
171+ lsn=$( psql -A -t -h $peer -c " SELECT spock.sync_event()" )
172+ echo " Wait until XLogRecord $lsn arrives and applies from $peer to $HOSTNAME "
173+ psql -A -t -h /tmp -c \
174+ " CALL spock.wait_for_sync_event(true, '$peer ', '$lsn '::pg_lsn, 30)"
175+ done
176+ echo " Finish after-Spockbench sync"
177+
171178spockbench-check $PGDATABASE > /home/pgedge/spock/spockbench-$HOSTNAME .out
172179# Check only this node's output file, not all nodes
173180grep -q " ERROR" /home/pgedge/spock/spockbench-$HOSTNAME .out && exit 1 || exit 0
0 commit comments