pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Restore replication protocol's duplicate command tags
5+ messages / 2 participants
[nested] [flat]

Commits from this thread:
  2020-10-15 7f47088183 9f783aea66  Fix query in new test to check tables are synced
* pgsql: Restore replication protocol's duplicate command tags
@ 2020-10-14 23:16 Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Alvaro Herrera @ 2020-10-14 23:16 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Restore replication protocol's duplicate command tags

I removed the duplicate command tags for START_REPLICATION inadvertently
in commit 07082b08cc5d, but the replication protocol requires them.  The
fact that the replication protocol was broken was not noticed because
all our test cases use an optimized code path that exits early, failing
to verify that the behavior is correct for non-optimized cases.  Put
them back.

Also document this protocol quirk.

Add a test case that shows the failure.  It might still succeed even
without the patch when run on a fast enough server, but it suffices to
show the bug in enough cases that it would be noticed in buildfarm.

Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
Reported-by: Henry Hinze <henry.hinze@gmail.com>
Reviewed-by: Petr Jelínek <petr.jelinek@2ndquadrant.com>
Discussion: https://postgr.es/m/16643-eaadeb2a1a58d28c@postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4e9821b6fac5042e872d5397f711a67984b165f8

Modified Files
--------------
doc/src/sgml/protocol.sgml               |  8 +++--
src/backend/replication/logical/worker.c |  1 -
src/backend/replication/walsender.c      |  3 +-
src/test/subscription/t/100_bugs.pl      | 55 +++++++++++++++++++++++++++++++-
4 files changed, 61 insertions(+), 6 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Restore replication protocol's duplicate command tags
@ 2020-10-14 23:16 Alvaro Herrera <alvherre@alvh.no-ip.org>
  2020-10-15 00:36 ` Re: pgsql: Restore replication protocol's duplicate command tags Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 1 reply; 5+ messages in thread

From: Alvaro Herrera @ 2020-10-14 23:16 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Restore replication protocol's duplicate command tags

I removed the duplicate command tags for START_REPLICATION inadvertently
in commit 07082b08cc5d, but the replication protocol requires them.  The
fact that the replication protocol was broken was not noticed because
all our test cases use an optimized code path that exits early, failing
to verify that the behavior is correct for non-optimized cases.  Put
them back.

Also document this protocol quirk.

Add a test case that shows the failure.  It might still succeed even
without the patch when run on a fast enough server, but it suffices to
show the bug in enough cases that it would be noticed in buildfarm.

Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
Reported-by: Henry Hinze <henry.hinze@gmail.com>
Reviewed-by: Petr Jelínek <petr.jelinek@2ndquadrant.com>
Discussion: https://postgr.es/m/16643-eaadeb2a1a58d28c@postgresql.org

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/72e43fc313e93c95704c574bcf98805805668063

Modified Files
--------------
doc/src/sgml/protocol.sgml               |  8 +++--
src/backend/replication/logical/worker.c |  1 -
src/backend/replication/walsender.c      |  3 +-
src/test/subscription/t/100_bugs.pl      | 55 +++++++++++++++++++++++++++++++-
4 files changed, 61 insertions(+), 6 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Restore replication protocol's duplicate command tags
  2020-10-14 23:16 pgsql: Restore replication protocol's duplicate command tags Alvaro Herrera <alvherre@alvh.no-ip.org>
@ 2020-10-15 00:36 ` Alvaro Herrera <alvherre@alvh.no-ip.org>
  2020-10-15 07:07   ` Re: pgsql: Restore replication protocol's duplicate command tags Amit Kapila <amit.kapila16@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Alvaro Herrera @ 2020-10-15 00:36 UTC (permalink / raw)
  To: pgsql-hackers@lists.postgresql.org

On 2020-Oct-14, Alvaro Herrera wrote:

> Add a test case that shows the failure.  It might still succeed even
> without the patch when run on a fast enough server, but it suffices to
> show the bug in enough cases that it would be noticed in buildfarm.

Hm, this failed on sidewinder.  I think the "wait for catchup" stuff in
logical replication is broken; I added a wait for sync workers to go
away after the normal wait_for_catchup, but evidently it is not
sufficient even with that.






^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Restore replication protocol's duplicate command tags
  2020-10-14 23:16 pgsql: Restore replication protocol's duplicate command tags Alvaro Herrera <alvherre@alvh.no-ip.org>
  2020-10-15 00:36 ` Re: pgsql: Restore replication protocol's duplicate command tags Alvaro Herrera <alvherre@alvh.no-ip.org>
@ 2020-10-15 07:07   ` Amit Kapila <amit.kapila16@gmail.com>
  2020-10-15 12:52     ` Re: pgsql: Restore replication protocol's duplicate command tags Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 1 reply; 5+ messages in thread

From: Amit Kapila @ 2020-10-15 07:07 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@alvh.no-ip.org>; +Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

On Thu, Oct 15, 2020 at 6:07 AM Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
>
> On 2020-Oct-14, Alvaro Herrera wrote:
>
> > Add a test case that shows the failure.  It might still succeed even
> > without the patch when run on a fast enough server, but it suffices to
> > show the bug in enough cases that it would be noticed in buildfarm.
>
> Hm, this failed on sidewinder.
>

Now, curculio [1] also seems to be failing for the same reason.

>  I think the "wait for catchup" stuff in
> logical replication is broken; I added a wait for sync workers to go
> away after the normal wait_for_catchup, but evidently it is not
> sufficient even with that.
>
>

For the initial table sync, we use below in some of the tests (see
001_rep_changes):

# Also wait for initial table sync to finish
my $synced_query =
  "SELECT count(1) = 0 FROM pg_subscription_rel WHERE srsubstate NOT
IN ('r', 's');";
$node_subscriber->poll_query_until('postgres', $synced_query)
  or die "Timed out while waiting for subscriber to synchronize data";

Is it not possible to use the same thing in this test as well?

[1] - https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=curculio&dt=2020-10-15%2005%3A30%3A43

-- 
With Regards,
Amit Kapila.





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Restore replication protocol's duplicate command tags
  2020-10-14 23:16 pgsql: Restore replication protocol's duplicate command tags Alvaro Herrera <alvherre@alvh.no-ip.org>
  2020-10-15 00:36 ` Re: pgsql: Restore replication protocol's duplicate command tags Alvaro Herrera <alvherre@alvh.no-ip.org>
  2020-10-15 07:07   ` Re: pgsql: Restore replication protocol's duplicate command tags Amit Kapila <amit.kapila16@gmail.com>
@ 2020-10-15 12:52     ` Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Alvaro Herrera @ 2020-10-15 12:52 UTC (permalink / raw)
  To: Amit Kapila <amit.kapila16@gmail.com>; +Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

On 2020-Oct-15, Amit Kapila wrote:

> On Thu, Oct 15, 2020 at 6:07 AM Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
> > On 2020-Oct-14, Alvaro Herrera wrote:

> > Hm, this failed on sidewinder.
> 
> Now, curculio [1] also seems to be failing for the same reason.

Yeah ... and now they're both green.  Anyway clearly the test is
unstable.

> For the initial table sync, we use below in some of the tests (see
> 001_rep_changes):

Ah yeah, thanks, this should work.  Pushed, we'll see how it goes.

Thanks,





^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2020-10-15 12:52 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-10-14 23:16 pgsql: Restore replication protocol's duplicate command tags Alvaro Herrera <alvherre@alvh.no-ip.org>
2020-10-14 23:16 pgsql: Restore replication protocol's duplicate command tags Alvaro Herrera <alvherre@alvh.no-ip.org>
2020-10-15 00:36 ` Alvaro Herrera <alvherre@alvh.no-ip.org>
2020-10-15 07:07   ` Amit Kapila <amit.kapila16@gmail.com>
2020-10-15 12:52     ` Alvaro Herrera <alvherre@alvh.no-ip.org>

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