Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gjrR2-0000p5-Fd for pgsql-bugs@arkaria.postgresql.org; Wed, 16 Jan 2019 20:05:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gjrR1-0005KW-14 for pgsql-bugs@arkaria.postgresql.org; Wed, 16 Jan 2019 20:05:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gjrR0-0005GO-OG for pgsql-bugs@lists.postgresql.org; Wed, 16 Jan 2019 20:05:10 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gjrQu-0001EC-Cy for pgsql-bugs@lists.postgresql.org; Wed, 16 Jan 2019 20:05:10 +0000 Received: by mail-lf1-x12b.google.com with SMTP id y11so5932446lfj.4 for ; Wed, 16 Jan 2019 12:05:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=TVwsgE0vIzYGN+6/R6IVBSBgfKZn37OAhBRttgHnRns=; b=cLVwTYlEGfKvLJu7Az9nPnyP/lIlnJQgyNiEfJ8Aqual2mL4khYok1xDES5PHNwr/V XOpZtKLq+kIkv1w7n+Tew12z7hbpR1jjVaBniLjJ6TokTyEi/DxusEjGZZt6wrgYcJDj 5XIIPROxk1yu8WC4lmQ9v/ZpZRPcoCrvdOD00xCcZWiN8TR46kVB6fjYUjibnqj8gbzy fNE8SswZqnhkdOGoZpMBBjOvvR22Q/NxAvOg7naXMuuCwYHGs2pmaSgTEqkk/urXuf/y WRbPs4bYXCNFH9cP8xnmw0h3y77Q0sDreNQQtZKy+9oXfd3WJRMmNZtv9Qq7y8HSpfUF 55wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=TVwsgE0vIzYGN+6/R6IVBSBgfKZn37OAhBRttgHnRns=; b=aoe+bFdaBRE0Ie/lexB6AsvfNbSlbZYE+/g0HUf+7HNF4Ix/s7ye66SjrGsxxHBR8b rzAVsdL+Raevd8Y+4iXNnHOE6HhvLxXNdEx5dGvi/oZGsgQsRAkI2EYWdS04iHHskd2J cJw8oFDDBZPZApA/aB71wKgNvwIV5ZoZqLEYJiZFD1Ccc2joeCwJ47Pu99c4GvGqz8QF cLzObE3qF1Gz+Jtv/4D1IqZj6F6AjFBq4FKmXUPMqMKnXIRkO+qCI+emLPUDy0eIK6fG PWEzDGCQ2C3cVhWDPY/XfooFmobVwX9j/bEVoKo4eiO3fB7Bj+J4t+Smin82fO/HEArZ 28cA== X-Gm-Message-State: AJcUukdTxhmqlE2qTLbvj2t89bRI3PG8OvCPLB852hAniCwgfKnCQxGD XRWNSPhiEefz8v2HVKdIrdGds1Kf X-Google-Smtp-Source: ALg8bN655OHVLdgCPZxSmCHZ1t8VjPufd2LPMm35OGQ0jE1DxJmm/BM0bh1o2FaWZz2smvsScYqKUQ== X-Received: by 2002:a19:3b45:: with SMTP id i66mr8456055lfa.28.1547669101586; Wed, 16 Jan 2019 12:05:01 -0800 (PST) Received: from [1.0.0.7] ([178.155.4.147]) by smtp.gmail.com with ESMTPSA id f8sm1363513lfb.2.2019.01.16.12.05.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 12:05:00 -0800 (PST) Subject: Re: BUG #15594: Unstable tests in contrib/test_decoding/output_iso/ To: Andres Freund , pgsql-bugs@lists.postgresql.org References: <15594-9df77c4c0da54c2c@postgresql.org> <20190116190949.veuctcodlttweumc@alap3.anarazel.de> From: Alexander Lakhin Message-ID: Date: Wed, 16 Jan 2019 23:04:59 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20190116190949.veuctcodlttweumc@alap3.anarazel.de> Content-Type: multipart/mixed; boundary="------------4C4184E3E71FDB5CD5C761CC" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------4C4184E3E71FDB5CD5C761CC Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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 --------------4C4184E3E71FDB5CD5C761CC Content-Type: text/x-patch; name="fix-15594.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fix-15594.patch" 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; } --------------4C4184E3E71FDB5CD5C761CC--