pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Lakhin <exclusion@gmail.com>
To: Andres Freund <andres@anarazel.de>
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15594: Unstable tests in contrib/test_decoding/output_iso/
Date: Wed, 16 Jan 2019 23:04:59 +0300
Message-ID: <d77c8872-e494-def5-0744-988e7973bf1b@gmail.com> (raw)
In-Reply-To: <20190116190949.veuctcodlttweumc@alap3.anarazel.de>
References: <15594-9df77c4c0da54c2c@postgresql.org>
	<20190116190949.veuctcodlttweumc@alap3.anarazel.de>

16.01.2019 22:09, Andres Freund wrote:
> On 2019-01-16 14:56:34 +0000, PG Bug reporting form wrote:
>> I observe this issue with the tests: mxact, delayed_startup, and
>> ondisk_startup.
> Interesting - I've not seen that on the buildfarm before, or in local tests
> with a lot of repetitions. I assume the problem vanishes if you add 'skip-empty-xacts', '1'
> to the options of pg_logical_slot_get_changes()?
>
> Greetings,
>
> Andres Freund
Thank you, Andres.
Yes, it helps. After applying the attached patch the issue is gone.
Just to note that mxact.out and ondisk_startup.out expected an empty
transaction.
If it's not important, then the fix is ready.

Best regards,
Alexander

Attachments:

fix-15594.patch (text/x-patch, 7.7K) download diff --git a/contrib/test_decoding/expected/delayed_startup.out b/contrib/test_decoding/expected/delayed_startup.out index db8c525ac4..fd5cd36a78 100644 --- a/contrib/test_decoding/expected/delayed_startup.out +++ b/contrib/test_decoding/expected/delayed_startup.out @@ -9,13 +9,13 @@ step s2init: <... completed> ?column? init -step s2start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); +step s2start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'skip-empty-xacts', '1'); data step s1b: BEGIN ISOLATION LEVEL SERIALIZABLE; step s1w: INSERT INTO do_write DEFAULT VALUES; step s1c: COMMIT; -step s2start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); +step s2start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'skip-empty-xacts', '1'); data BEGIN @@ -23,11 +23,11 @@ table public.do_write: INSERT: id[integer]:2 COMMIT step s1b: BEGIN ISOLATION LEVEL SERIALIZABLE; step s1w: INSERT INTO do_write DEFAULT VALUES; -step s2start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); +step s2start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'skip-empty-xacts', '1'); data step s1c: COMMIT; -step s2start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); +step s2start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'skip-empty-xacts', '1'); data BEGIN diff --git a/contrib/test_decoding/expected/mxact.out b/contrib/test_decoding/expected/mxact.out index f0d96cc67d..6ef83d5958 100644 --- a/contrib/test_decoding/expected/mxact.out +++ b/contrib/test_decoding/expected/mxact.out @@ -5,7 +5,7 @@ step s0init: SELECT 'init' FROM pg_create_logical_replication_slot('isolation_sl ?column? init -step s0start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); +step s0start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'skip-empty-xacts', '1'); data step s1begin: BEGIN; @@ -19,7 +19,7 @@ step s2sharepgclass: SELECT count(*) > 1 FROM (SELECT * FROM pg_class FOR SHARE) t step s0w: INSERT INTO do_write DEFAULT VALUES; -step s0start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); +step s0start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'skip-empty-xacts', '1'); data BEGIN @@ -36,7 +36,7 @@ step s0init: SELECT 'init' FROM pg_create_logical_replication_slot('isolation_sl ?column? init -step s0start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); +step s0start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'skip-empty-xacts', '1'); data step s1begin: BEGIN; @@ -51,11 +51,9 @@ step s2keysharepgclass: SELECT count(*) > 1 FROM (SELECT * FROM pg_class FOR KEY t step s0alter: ALTER TABLE do_write ADD column ts timestamptz; step s0w: INSERT INTO do_write DEFAULT VALUES; -step s0start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); +step s0start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'skip-empty-xacts', '1'); data -BEGIN -COMMIT BEGIN table public.do_write: INSERT: id[integer]:1 ts[timestamp with time zone]:null COMMIT diff --git a/contrib/test_decoding/expected/ondisk_startup.out b/contrib/test_decoding/expected/ondisk_startup.out index c7b1f45b46..a0f9acc7a6 100644 --- a/contrib/test_decoding/expected/ondisk_startup.out +++ b/contrib/test_decoding/expected/ondisk_startup.out @@ -27,7 +27,7 @@ init step s2c: COMMIT; step s1insert: INSERT INTO do_write DEFAULT VALUES; step s1checkpoint: CHECKPOINT; -step s1start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); +step s1start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'skip-empty-xacts', '1'); data BEGIN @@ -36,15 +36,13 @@ COMMIT step s1insert: INSERT INTO do_write DEFAULT VALUES; step s1alter: ALTER TABLE do_write ADD COLUMN addedbys1 int; step s1insert: INSERT INTO do_write DEFAULT VALUES; -step s1start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); +step s1start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'skip-empty-xacts', '1'); data BEGIN table public.do_write: INSERT: id[integer]:2 addedbys2[integer]:null COMMIT BEGIN -COMMIT -BEGIN table public.do_write: INSERT: id[integer]:3 addedbys2[integer]:null addedbys1[integer]:null COMMIT ?column? diff --git a/contrib/test_decoding/specs/delayed_startup.spec b/contrib/test_decoding/specs/delayed_startup.spec index b7fe8148ce..949f05a24f 100644 --- a/contrib/test_decoding/specs/delayed_startup.spec +++ b/contrib/test_decoding/specs/delayed_startup.spec @@ -18,7 +18,7 @@ step "s1c" { COMMIT; } session "s2" setup { SET synchronous_commit=on; } step "s2init" {SELECT 'init' FROM pg_create_logical_replication_slot('isolation_slot', 'test_decoding');} -step "s2start" {SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false');} +step "s2start" {SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'skip-empty-xacts', '1');} permutation "s1b" "s1w" "s2init" "s1c" "s2start" "s1b" "s1w" "s1c" "s2start" "s1b" "s1w" "s2start" "s1c" "s2start" diff --git a/contrib/test_decoding/specs/mxact.spec b/contrib/test_decoding/specs/mxact.spec index ea5b1aa2d6..7d8abf411a 100644 --- a/contrib/test_decoding/specs/mxact.spec +++ b/contrib/test_decoding/specs/mxact.spec @@ -13,7 +13,7 @@ teardown session "s0" setup { SET synchronous_commit=on; } step "s0init" {SELECT 'init' FROM pg_create_logical_replication_slot('isolation_slot', 'test_decoding');} -step "s0start" {SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false');} +step "s0start" {SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'skip-empty-xacts', '1');} step "s0alter" {ALTER TABLE do_write ADD column ts timestamptz; } step "s0w" { INSERT INTO do_write DEFAULT VALUES; } diff --git a/contrib/test_decoding/specs/ondisk_startup.spec b/contrib/test_decoding/specs/ondisk_startup.spec index 12c57a813d..48c67a770a 100644 --- a/contrib/test_decoding/specs/ondisk_startup.spec +++ b/contrib/test_decoding/specs/ondisk_startup.spec @@ -16,7 +16,7 @@ session "s1" setup { SET synchronous_commit=on; } step "s1init" {SELECT 'init' FROM pg_create_logical_replication_slot('isolation_slot', 'test_decoding');} -step "s1start" {SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false');} +step "s1start" {SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'skip-empty-xacts', '1');} step "s1insert" { INSERT INTO do_write DEFAULT VALUES; } step "s1checkpoint" { CHECKPOINT; } step "s1alter" { ALTER TABLE do_write ADD COLUMN addedbys1 int; }

view thread (7+ messages)  latest in thread

Message-ID: <d77c8872-e494-def5-0744-988e7973bf1b@gmail.com>
Permalink:  ../d77c8872-e494-def5-0744-988e7973bf1b@gmail.com/
Also on:    postgresql.org/message-id/d77c8872-e494-def5-0744-988e7973bf1b@gmail.com

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: exclusion@gmail.com, andres@anarazel.de
  Subject: Re: BUG #15594: Unstable tests in contrib/test_decoding/output_iso/
  In-Reply-To: <d77c8872-e494-def5-0744-988e7973bf1b@gmail.com>
  References: <15594-9df77c4c0da54c2c@postgresql.org> <20190116190949.veuctcodlttweumc@alap3.anarazel.de> <d77c8872-e494-def5-0744-988e7973bf1b@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox