Re: [HACKERS] Timing-sensitive case in src/test/recovery TAP tests

2017-08-12 Thread Michael Paquier
On Sun, Aug 13, 2017 at 1:09 AM, Tom Lane wrote: > Michael Paquier writes: >> On Wed, Aug 9, 2017 at 3:39 PM, Tom Lane wrote: >>> Michael Paquier writes: Let's do that please. Merging both was my first feeling when refactoring this test upthread. Should I send a patch? > >>> Sure, hav

Re: [HACKERS] Timing-sensitive case in src/test/recovery TAP tests

2017-08-12 Thread Tom Lane
Michael Paquier writes: > On Wed, Aug 9, 2017 at 3:39 PM, Tom Lane wrote: >> Michael Paquier writes: >>> Let's do that please. Merging both was my first feeling when >>> refactoring this test upthread. Should I send a patch? >> Sure, have at it. > And here you go. Pushed with a bit of work on

Re: [HACKERS] Timing-sensitive case in src/test/recovery TAP tests

2017-08-09 Thread Michael Paquier
On Wed, Aug 9, 2017 at 3:39 PM, Tom Lane wrote: > Michael Paquier writes: >> On Tue, Aug 8, 2017 at 11:33 PM, Tom Lane wrote: >>> Michael Paquier writes: I got the same thought, wondering as well if get_slot_xmins should be renamed check_slot_xmins with the is() tests moved inside it

Re: [HACKERS] Timing-sensitive case in src/test/recovery TAP tests

2017-08-09 Thread Tom Lane
Michael Paquier writes: > On Tue, Aug 8, 2017 at 11:33 PM, Tom Lane wrote: >> Michael Paquier writes: >>> I got the same thought, wondering as well if get_slot_xmins should be >>> renamed check_slot_xmins with the is() tests moved inside it as well. >>> Not sure if that's worth the API ugliness

Re: [HACKERS] Timing-sensitive case in src/test/recovery TAP tests

2017-08-08 Thread Michael Paquier
On Tue, Aug 8, 2017 at 11:33 PM, Tom Lane wrote: > Michael Paquier writes: >> I got the same thought, wondering as well if get_slot_xmins should be >> renamed check_slot_xmins with the is() tests moved inside it as well. >> Not sure if that's worth the API ugliness though. > > Mmm, doesn't seem l

Re: [HACKERS] Timing-sensitive case in src/test/recovery TAP tests

2017-08-08 Thread Tom Lane
Michael Paquier writes: > On Tue, Jun 27, 2017 at 3:44 AM, Tom Lane wrote: >> Looks good as far as it goes, but I wonder whether any of the other >> get_slot_xmins calls need polling too. Don't feel a need to add such >> calls until someone exhibits a failure there, but I won't be very >> surpri

Re: [HACKERS] Timing-sensitive case in src/test/recovery TAP tests

2017-06-26 Thread Michael Paquier
On Tue, Jun 27, 2017 at 3:44 AM, Tom Lane wrote: > Looks good as far as it goes, but I wonder whether any of the other > get_slot_xmins calls need polling too. Don't feel a need to add such > calls until someone exhibits a failure there, but I won't be very > surprised if someone does. I got the

Re: [HACKERS] Timing-sensitive case in src/test/recovery TAP tests

2017-06-26 Thread Tom Lane
Michael Paquier writes: > On Mon, Jun 26, 2017 at 12:12 PM, Craig Ringer wrote: >> I'm not sure I understand this. > The patch attached may explain that better. Your patch added 3 poll > phases. I think that a 4th is needed. At the same time I have found > cleaner to put the poll calls into a sm

Re: [HACKERS] Timing-sensitive case in src/test/recovery TAP tests

2017-06-25 Thread Michael Paquier
On Mon, Jun 26, 2017 at 12:12 PM, Craig Ringer wrote: > On 26 June 2017 at 11:06, Michael Paquier wrote: > >> As long as we are on it, there is this code block in the test: >> my ($xmin, $catalog_xmin) = get_slot_xmins($node_master, $slotname_1); >> is($xmin, '', 'non-cascaded slot xmin n

Re: [HACKERS] Timing-sensitive case in src/test/recovery TAP tests

2017-06-25 Thread Craig Ringer
On 26 June 2017 at 11:06, Michael Paquier wrote: > As long as we are on it, there is this code block in the test: > my ($xmin, $catalog_xmin) = get_slot_xmins($node_master, $slotname_1); > is($xmin, '', 'non-cascaded slot xmin null with no hs_feedback'); > is($catalog_xmin, '', 'non-casca

Re: [HACKERS] Timing-sensitive case in src/test/recovery TAP tests

2017-06-25 Thread Michael Paquier
On Mon, Jun 26, 2017 at 11:44 AM, Craig Ringer wrote: > On 26 June 2017 at 10:09, Tom Lane wrote: >> Michael Paquier writes: >>> On Mon, Jun 26, 2017 at 10:48 AM, Craig Ringer >>> wrote: $node_standby_1->poll_query_until('postgres', q[SELECT xmin IS NULL from pg_replication_slots WHE

Re: [HACKERS] Timing-sensitive case in src/test/recovery TAP tests

2017-06-25 Thread Craig Ringer
On 26 June 2017 at 10:09, Tom Lane wrote: > Michael Paquier writes: >> On Mon, Jun 26, 2017 at 10:48 AM, Craig Ringer wrote: >>> $node_standby_1->poll_query_until('postgres', q[SELECT xmin IS NULL >>> from pg_replication_slots WHERE slot_name = '] . $slotname_2 . q[']); > >> +1 for avoiding a sl

Re: [HACKERS] Timing-sensitive case in src/test/recovery TAP tests

2017-06-25 Thread Tom Lane
Michael Paquier writes: > On Mon, Jun 26, 2017 at 10:48 AM, Craig Ringer wrote: >> $node_standby_1->poll_query_until('postgres', q[SELECT xmin IS NULL >> from pg_replication_slots WHERE slot_name = '] . $slotname_2 . q[']); > +1 for avoiding a sleep call if it is not necessary. Fast platforms >

Re: [HACKERS] Timing-sensitive case in src/test/recovery TAP tests

2017-06-25 Thread Michael Paquier
On Mon, Jun 26, 2017 at 10:48 AM, Craig Ringer wrote: > $node_standby_1->poll_query_until('postgres', q[SELECT xmin IS NULL > from pg_replication_slots WHERE slot_name = '] . $slotname_2 . q[']); +1 for avoiding a sleep call if it is not necessary. Fast platforms would always pay a cost on that,

Re: [HACKERS] Timing-sensitive case in src/test/recovery TAP tests

2017-06-25 Thread Craig Ringer
On 26 June 2017 at 05:10, Tom Lane wrote: > I've been experimenting with a change to pg_ctl, which I'll post > separately, to reduce its reaction time so that it reports success > more quickly after a wait for postmaster start/stop. I found one > case in "make check-world" that got a failure when

[HACKERS] Timing-sensitive case in src/test/recovery TAP tests

2017-06-25 Thread Tom Lane
I've been experimenting with a change to pg_ctl, which I'll post separately, to reduce its reaction time so that it reports success more quickly after a wait for postmaster start/stop. I found one case in "make check-world" that got a failure when I reduced the reaction time to ~1ms. That's the v