Re: Introduce wait_for_subscription_sync for TAP tests

2022-09-29 Thread Thomas Munro
On Mon, Sep 12, 2022 at 10:42 PM Thomas Munro wrote: > On Sat, Sep 10, 2022 at 10:00 AM Thomas Munro wrote: > > On Sat, Sep 10, 2022 at 9:45 AM Tom Lane wrote: > > > Masahiko Sawada writes: > > > > It's likely that the commit f6c5edb8abcac04eb3eac6da356e59d399b2bcef > > > > is relevant. > > > >

Re: Introduce wait_for_subscription_sync for TAP tests

2022-09-12 Thread Thomas Munro
On Sat, Sep 10, 2022 at 10:00 AM Thomas Munro wrote: > On Sat, Sep 10, 2022 at 9:45 AM Tom Lane wrote: > > Masahiko Sawada writes: > > > It's likely that the commit f6c5edb8abcac04eb3eac6da356e59d399b2bcef > > > is relevant. > > > > Noting that the errors have only appeared in the past couple of

Re: Introduce wait_for_subscription_sync for TAP tests

2022-09-09 Thread Thomas Munro
On Sat, Sep 10, 2022 at 9:45 AM Tom Lane wrote: > Masahiko Sawada writes: > > On Fri, Sep 9, 2022 at 11:31 PM Tom Lane wrote: > >> Recently a number of buildfarm animals have failed at the same > >> place in src/test/subscription/t/100_bugs.pl [1][2][3][4]: > >> > >> # Failed test '2x3000 rows

Re: Introduce wait_for_subscription_sync for TAP tests

2022-09-09 Thread Masahiko Sawada
On Sat, Sep 10, 2022 at 6:45 AM Tom Lane wrote: > > Masahiko Sawada writes: > > On Fri, Sep 9, 2022 at 11:31 PM Tom Lane wrote: > >> Recently a number of buildfarm animals have failed at the same > >> place in src/test/subscription/t/100_bugs.pl [1][2][3][4]: > >> > >> # Failed test '2x3000 ro

Re: Introduce wait_for_subscription_sync for TAP tests

2022-09-09 Thread Tom Lane
Masahiko Sawada writes: > On Fri, Sep 9, 2022 at 11:31 PM Tom Lane wrote: >> Recently a number of buildfarm animals have failed at the same >> place in src/test/subscription/t/100_bugs.pl [1][2][3][4]: >> >> # Failed test '2x3000 rows in t' >> # at t/100_bugs.pl line 149. >> # got:

Re: Introduce wait_for_subscription_sync for TAP tests

2022-09-09 Thread Masahiko Sawada
On Fri, Sep 9, 2022 at 11:31 PM Tom Lane wrote: > > Amit Kapila writes: > > Pushed. > > Recently a number of buildfarm animals have failed at the same > place in src/test/subscription/t/100_bugs.pl [1][2][3][4]: > > # Failed test '2x3000 rows in t' > # at t/100_bugs.pl line 149. > #

Re: Introduce wait_for_subscription_sync for TAP tests

2022-09-09 Thread Tom Lane
Amit Kapila writes: > Pushed. Recently a number of buildfarm animals have failed at the same place in src/test/subscription/t/100_bugs.pl [1][2][3][4]: # Failed test '2x3000 rows in t' # at t/100_bugs.pl line 149. # got: '9000' # expected: '6000' # Looks like you failed 1 test o

Re: Introduce wait_for_subscription_sync for TAP tests

2022-08-12 Thread Amit Kapila
On Wed, Aug 10, 2022 at 10:39 AM Masahiko Sawada wrote: > > On Fri, Aug 5, 2022 at 10:39 AM shiy.f...@fujitsu.com > wrote: > > Thank you for the comments. I've attached updated version patches. > Please review them. > Pushed. -- With Regards, Amit Kapila.

Re: Introduce wait_for_subscription_sync for TAP tests

2022-08-04 Thread Amit Kapila
On Thu, Aug 4, 2022 at 7:13 PM Tom Lane wrote: > > Masahiko Sawada writes: > > Yes. I've attached patches for backbranches. > > FWIW, I'd recommend waiting till after next week's wrap before > pushing these. While I'm definitely in favor of doing this, > the odds of introducing a bug are nonzero

RE: Introduce wait_for_subscription_sync for TAP tests

2022-08-04 Thread shiy.f...@fujitsu.com
On Thu, Aug 4, 2022 5:49 PM shiy.f...@fujitsu.com wrote: > > On Thu, Aug 4, 2022 2:28 PM Masahiko Sawada > wrote: > > > > On Thu, Aug 4, 2022 at 10:37 AM Amit Kapila > > wrote: > > > > > > On Wed, Aug 3, 2022 at 10:21 AM Amit Kapila > > > wrote: > > > > > > > > Pushed this one and now I'll loo

Re: Introduce wait_for_subscription_sync for TAP tests

2022-08-04 Thread Tom Lane
Masahiko Sawada writes: > Yes. I've attached patches for backbranches. FWIW, I'd recommend waiting till after next week's wrap before pushing these. While I'm definitely in favor of doing this, the odds of introducing a bug are nonzero, so right before a release deadline doesn't seem like a good

RE: Introduce wait_for_subscription_sync for TAP tests

2022-08-04 Thread shiy.f...@fujitsu.com
On Thu, Aug 4, 2022 2:28 PM Masahiko Sawada wrote: > > On Thu, Aug 4, 2022 at 10:37 AM Amit Kapila > wrote: > > > > On Wed, Aug 3, 2022 at 10:21 AM Amit Kapila > wrote: > > > > > > Pushed this one and now I'll look at your other patch. > > > > > > > I have pushed the second patch as well after

Re: Introduce wait_for_subscription_sync for TAP tests

2022-08-03 Thread Amit Kapila
On Wed, Aug 3, 2022 at 10:21 AM Amit Kapila wrote: > > Pushed this one and now I'll look at your other patch. > I have pushed the second patch as well after making minor changes in the comments. Alvaro [1] and Tom [2] suggest to back-patch this and they sound reasonable to me. Will you be able to

Re: Introduce wait_for_subscription_sync for TAP tests

2022-08-02 Thread Masahiko Sawada
On Wed, Aug 3, 2022 at 1:51 PM Amit Kapila wrote: > > On Sat, Jul 30, 2022 at 12:25 PM Amit Kapila wrote: > > > > On Thu, Jul 28, 2022 at 6:37 AM Masahiko Sawada > > wrote: > > > > > > On Wed, Jul 27, 2022 at 7:08 PM shiy.f...@fujitsu.com > > > wrote: > > > > > > I've attached updated patches

Re: Introduce wait_for_subscription_sync for TAP tests

2022-08-02 Thread Amit Kapila
On Sat, Jul 30, 2022 at 12:25 PM Amit Kapila wrote: > > On Thu, Jul 28, 2022 at 6:37 AM Masahiko Sawada wrote: > > > > On Wed, Jul 27, 2022 at 7:08 PM shiy.f...@fujitsu.com > > wrote: > > > > I've attached updated patches that incorporated the above comments as > > well as the comment from Amit.

Re: Introduce wait_for_subscription_sync for TAP tests

2022-07-29 Thread Amit Kapila
On Thu, Jul 28, 2022 at 6:37 AM Masahiko Sawada wrote: > > On Wed, Jul 27, 2022 at 7:08 PM shiy.f...@fujitsu.com > wrote: > > I've attached updated patches that incorporated the above comments as > well as the comment from Amit. > > BTW regarding 0001 patch to remove the duplicated wait, should w

Re: Introduce wait_for_subscription_sync for TAP tests

2022-07-27 Thread Masahiko Sawada
On Wed, Jul 27, 2022 at 8:54 PM Amit Kapila wrote: > > On Tue, Jul 26, 2022 at 1:12 PM Masahiko Sawada wrote: > > > > On Tue, Jul 26, 2022 at 2:01 PM Amit Kapila wrote: > > > > > > 2. > > > +# wait for the replication to catchup if required. > > > +if (defined($publisher)) > > > +{ >

Re: Introduce wait_for_subscription_sync for TAP tests

2022-07-27 Thread Masahiko Sawada
On Wed, Jul 27, 2022 at 7:08 PM shiy.f...@fujitsu.com wrote: > > On Tue, Jul 26, 2022 3:42 PM Masahiko Sawada wrote: > > > > I've attached an updated patch as well as a patch to remove duplicated > > waits in 007_ddl.pl. > > > > Thanks for your patch. Here are some comments. Thank you for the co

Re: Introduce wait_for_subscription_sync for TAP tests

2022-07-27 Thread Amit Kapila
On Tue, Jul 26, 2022 at 1:12 PM Masahiko Sawada wrote: > > On Tue, Jul 26, 2022 at 2:01 PM Amit Kapila wrote: > > > > 2. > > +# wait for the replication to catchup if required. > > +if (defined($publisher)) > > +{ > > + croak 'subscription name must be specified' unless defined($subna

RE: Introduce wait_for_subscription_sync for TAP tests

2022-07-27 Thread shiy.f...@fujitsu.com
On Tue, Jul 26, 2022 3:42 PM Masahiko Sawada wrote: > > I've attached an updated patch as well as a patch to remove duplicated > waits in 007_ddl.pl. > Thanks for your patch. Here are some comments. 1. I think some comments need to be changed in the patch. For example: # Also wait for initial

Re: Introduce wait_for_subscription_sync for TAP tests

2022-07-26 Thread Masahiko Sawada
ery) or die "Timed out while waiting for subscriber to synchronize data"; -# Also wait for initial table sync to finish. -$node_subscriber->poll_query_until('postgres', $synced_query) - or die "Timed out while waiting for subscriber to synchronize data"; - # S

Re: Introduce wait_for_subscription_sync for TAP tests

2022-07-25 Thread Amit Kapila
On Tue, Jul 26, 2022 at 7:07 AM Masahiko Sawada wrote: > > Hi, > > In tap tests for logical replication, we have the following code in many > places: > > $node_publisher->wait_for_catchup('tap_sub'); > my $synced_query = > "SELECT count(1) = 0 FROM pg_subscription_rel WHERE srsubstate NOT > IN

Introduce wait_for_subscription_sync for TAP tests

2022-07-25 Thread Masahiko Sawada
Hi, In tap tests for logical replication, we have the following code in many places: $node_publisher->wait_for_catchup('tap_sub'); 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)