@@ -167,16 +167,15 @@ SELECT id, payload FROM test_spill;
167167 -1 | 50000
168168(1 row)
169169
170- SELECT command_counter AS cnt,operation AS opt,
171- remote_new_tup FROM spock.exception_log
170+ SELECT operation AS opt, remote_new_tup FROM spock.exception_log
172171ORDER BY command_counter DESC LIMIT 5;
173- cnt | opt | remote_new_tup
174- -------+------- -+-------------------------------------------------------------------------------------------------------------------
175- 50013 | INSERT | [{"value": 50000, "attname": "id", "atttype": "int4"}, {"value": 50000, "attname": "payload", "atttype": "int4"}]
176- 50012 | INSERT | [{"value": 49999, "attname": "id", "atttype": "int4"}, {"value": 49999, "attname": "payload", "atttype": "int4"}]
177- 50011 | INSERT | [{"value": 49998, "attname": "id", "atttype": "int4"}, {"value": 49998, "attname": "payload", "atttype": "int4"}]
178- 50010 | INSERT | [{"value": 49997, "attname": "id", "atttype": "int4"}, {"value": 49997, "attname": "payload", "atttype": "int4"}]
179- 50009 | INSERT | [{"value": 49996, "attname": "id", "atttype": "int4"}, {"value": 49996, "attname": "payload", "atttype": "int4"}]
172+ opt | remote_new_tup
173+ --------+-------------------------------------------------------------------------------------------------------------------
174+ INSERT | [{"value": 50000, "attname": "id", "atttype": "int4"}, {"value": 50000, "attname": "payload", "atttype": "int4"}]
175+ INSERT | [{"value": 49999, "attname": "id", "atttype": "int4"}, {"value": 49999, "attname": "payload", "atttype": "int4"}]
176+ INSERT | [{"value": 49998, "attname": "id", "atttype": "int4"}, {"value": 49998, "attname": "payload", "atttype": "int4"}]
177+ INSERT | [{"value": 49997, "attname": "id", "atttype": "int4"}, {"value": 49997, "attname": "payload", "atttype": "int4"}]
178+ INSERT | [{"value": 49996, "attname": "id", "atttype": "int4"}, {"value": 49996, "attname": "payload", "atttype": "int4"}]
180179(5 rows)
181180
182181-- ============================================================
@@ -221,16 +220,15 @@ SELECT count(*), sum(id), sum(payload) FROM test_spill;
221220 50000 | 1249974999 | 1250025000
222221(1 row)
223222
224- SELECT command_counter AS cnt,operation AS opt,
225- remote_new_tup FROM spock.exception_log
223+ SELECT operation AS opt,remote_new_tup FROM spock.exception_log
226224ORDER BY command_counter DESC LIMIT 5;
227- cnt | opt | remote_new_tup
228- --------+--------+-------- -----------------------------------------------------------------------------------------------------------
229- 100013 | INSERT | [{"value": 50000, "attname": "id", "atttype": "int4"}, {"value": 50000, "attname": "payload", "atttype": "int4"}]
230- 100012 | INSERT | [{"value": 49999, "attname": "id", "atttype": "int4"}, {"value": 49999, "attname": "payload", "atttype": "int4"}]
231- 100011 | INSERT | [{"value": 49998, "attname": "id", "atttype": "int4"}, {"value": 49998, "attname": "payload", "atttype": "int4"}]
232- 100010 | INSERT | [{"value": 49997, "attname": "id", "atttype": "int4"}, {"value": 49997, "attname": "payload", "atttype": "int4"}]
233- 100009 | INSERT | [{"value": 49996, "attname": "id", "atttype": "int4"}, {"value": 49996, "attname": "payload", "atttype": "int4"}]
225+ opt | remote_new_tup
226+ --------+-------------------------------------------------------------------------------------------------------------------
227+ INSERT | [{"value": 50000, "attname": "id", "atttype": "int4"}, {"value": 50000, "attname": "payload", "atttype": "int4"}]
228+ INSERT | [{"value": 49999, "attname": "id", "atttype": "int4"}, {"value": 49999, "attname": "payload", "atttype": "int4"}]
229+ INSERT | [{"value": 49998, "attname": "id", "atttype": "int4"}, {"value": 49998, "attname": "payload", "atttype": "int4"}]
230+ INSERT | [{"value": 49997, "attname": "id", "atttype": "int4"}, {"value": 49997, "attname": "payload", "atttype": "int4"}]
231+ INSERT | [{"value": 49996, "attname": "id", "atttype": "int4"}, {"value": 49996, "attname": "payload", "atttype": "int4"}]
234232(5 rows)
235233
236234-- ============================================================
@@ -239,25 +237,35 @@ ORDER BY command_counter DESC LIMIT 5;
239237-- conflicting row, re-enable, and verify the transaction
240238-- is applied successfully.
241239-- ============================================================
240+ \c :provider_dsn
241+ TRUNCATE test_spill RESTART IDENTITY;
242+ SELECT spock.sync_event() as sync_lsn \gset
242243\c :subscriber_dsn
244+ CALL spock.wait_for_sync_event(NULL, 'test_provider', :'sync_lsn', 30);
245+ result
246+ --------
247+ t
248+ (1 row)
249+
243250ALTER SYSTEM SET spock.exception_behaviour = 'sub_disable';
244251SELECT pg_reload_conf();
245252 pg_reload_conf
246253----------------
247254 t
248255(1 row)
249256
250- \c :provider_dsn
251- TRUNCATE test_spill RESTART IDENTITY;
252- SELECT spock.sync_event() as sync_lsn
253- \gset
254- \c :subscriber_dsn
255- CALL spock.wait_for_sync_event(NULL, 'test_provider', :'sync_lsn', 30);
256- result
257- --------
258- t
257+ -- Check that all works and clean on subscriber
258+ SELECT status FROM spock.sub_show_status('test_subscription');
259+ status
260+ -------------
261+ replicating
259262(1 row)
260263
264+ SELECT * FROM test_spill; -- empty
265+ id | payload
266+ ----+---------
267+ (0 rows)
268+
261269INSERT INTO test_spill (id, payload) VALUES (-1, 50000); -- Add conflicting record
262270\c :provider_dsn
263271COPY test_spill (id) FROM PROGRAM 'seq 1 50000' WITH (FORMAT text);
@@ -304,16 +312,15 @@ SELECT node_name,relname,idxname,conflict_type,conflict_resolution,
304312-----------+---------+---------+---------------+---------------------+-------------+--------------
305313(0 rows)
306314
307- SELECT command_counter AS cnt,operation AS opt,
308- remote_new_tup FROM spock.exception_log
315+ SELECT operation AS opt, remote_new_tup FROM spock.exception_log
309316ORDER BY command_counter DESC LIMIT 5;
310- cnt | opt | remote_new_tup
311- --------+-------- -----+-------------------------------------------------------------------------------------------------------------------
312- 150014 | SUB_DISABLE |
313- 150013 | INSERT | [{"value": 50000, "attname": "id", "atttype": "int4"}, {"value": 50000, "attname": "payload", "atttype": "int4"}]
314- 150012 | INSERT | [{"value": 49999, "attname": "id", "atttype": "int4"}, {"value": 49999, "attname": "payload", "atttype": "int4"}]
315- 150011 | INSERT | [{"value": 49998, "attname": "id", "atttype": "int4"}, {"value": 49998, "attname": "payload", "atttype": "int4"}]
316- 150010 | INSERT | [{"value": 49997, "attname": "id", "atttype": "int4"}, {"value": 49997, "attname": "payload", "atttype": "int4"}]
317+ opt | remote_new_tup
318+ -------------+-------------------------------------------------------------------------------------------------------------------
319+ SUB_DISABLE |
320+ INSERT | [{"value": 50000, "attname": "id", "atttype": "int4"}, {"value": 50000, "attname": "payload", "atttype": "int4"}]
321+ INSERT | [{"value": 49999, "attname": "id", "atttype": "int4"}, {"value": 49999, "attname": "payload", "atttype": "int4"}]
322+ INSERT | [{"value": 49998, "attname": "id", "atttype": "int4"}, {"value": 49998, "attname": "payload", "atttype": "int4"}]
323+ INSERT | [{"value": 49997, "attname": "id", "atttype": "int4"}, {"value": 49997, "attname": "payload", "atttype": "int4"}]
317324(5 rows)
318325
319326-- ============================================================
0 commit comments