pgsql: Add adjust_conf method to PostgresNode

2021-07-29 Thread Andrew Dunstan
Add adjust_conf method to PostgresNode

This method will modify or delete an existing line in the config file
rather than simply appending to the file. This makes adjustment of files
for older versions much simpler and more compact.

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/dbfe6e4b1766369654e20113b0cab79bd939d544

Modified Files
--
src/test/perl/PostgresNode.pm | 49 ++-
1 file changed, 48 insertions(+), 1 deletion(-)



pgsql: Remove the last vestiges of Exporter from PostgresNode

2021-07-29 Thread Andrew Dunstan
Remove the last vestiges of Exporter from PostgresNode

Clients wanting to call get_free_port now need to do so via a qualified
name: PostgresNode::get_free_port().

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/5dc932f9e7b7d1992abd33d1c519899dd1c30272

Modified Files
--
src/bin/pg_ctl/t/001_start_stop.pl |  2 +-
src/test/kerberos/t/001_auth.pl|  2 +-
src/test/ldap/t/001_auth.pl|  4 ++--
src/test/perl/PostgresNode.pm  | 14 ++
4 files changed, 10 insertions(+), 12 deletions(-)



pgsql: Add -w back to the flags for pg_ctl (re)start in PostgresNode

2021-07-29 Thread Andrew Dunstan
Add -w back to the flags for pg_ctl (re)start in PostgresNode

This is now the default for pg_ctl, but having the flag here explicitly
does no harm and helps with backwards compatibility of the PostgresNode
module.

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/b33259e261ae99dc7c503a6a7615bd492047588b

Modified Files
--
src/test/perl/PostgresNode.pm | 8 ++--
1 file changed, 6 insertions(+), 2 deletions(-)



pgsql: Unify PostgresNode's new() and get_new_node() methods

2021-07-29 Thread Andrew Dunstan
Unify PostgresNode's new() and get_new_node() methods

There is only one constructor now for PostgresNode, with the idiomatic
name 'new'. The method is not exported by the class, and must be called
as "PostgresNode->new('name',[args])". All the TAP tests that use
PostgresNode are modified accordingly. Third party scripts will need
adjusting, which is a fairly mechanical process (I just used a sed
script).

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/201a76183e2056c2217129e12d68c25ec9c559c8

Modified Files
--
contrib/amcheck/t/001_verify_heapam.pl |  2 +-
contrib/auto_explain/t/001_auto_explain.pl |  2 +-
contrib/bloom/t/001_wal.pl |  4 +-
contrib/test_decoding/t/001_repl_stats.pl  |  2 +-
src/bin/pg_amcheck/t/002_nonesuch.pl   |  2 +-
src/bin/pg_amcheck/t/003_check.pl  |  2 +-
src/bin/pg_amcheck/t/004_verify_heapam.pl  |  2 +-
src/bin/pg_amcheck/t/005_opclass_damage.pl |  2 +-
src/bin/pg_basebackup/t/010_pg_basebackup.pl   |  4 +-
src/bin/pg_basebackup/t/020_pg_receivewal.pl   |  2 +-
src/bin/pg_basebackup/t/030_pg_recvlogical.pl  |  2 +-
src/bin/pg_checksums/t/002_actions.pl  |  2 +-
src/bin/pg_controldata/t/001_pg_controldata.pl |  2 +-
src/bin/pg_ctl/t/002_status.pl |  2 +-
src/bin/pg_ctl/t/003_promote.pl|  6 +-
src/bin/pg_ctl/t/004_logrotate.pl  |  2 +-
src/bin/pg_dump/t/002_pg_dump.pl   |  2 +-
src/bin/pg_dump/t/003_pg_dump_with_server.pl   |  2 +-
src/bin/pg_dump/t/010_dump_connstr.pl  |  6 +-
src/bin/pg_resetwal/t/001_basic.pl |  2 +-
src/bin/pg_resetwal/t/002_corrupted.pl |  2 +-
src/bin/pg_rewind/t/007_standby_source.pl  |  4 +-
src/bin/pg_rewind/t/008_min_recovery_point.pl  |  6 +-
src/bin/pg_rewind/t/RewindTest.pm  |  4 +-
src/bin/pg_verifybackup/t/002_algorithm.pl |  2 +-
src/bin/pg_verifybackup/t/003_corruption.pl|  2 +-
src/bin/pg_verifybackup/t/004_options.pl   |  2 +-
src/bin/pg_verifybackup/t/006_encoding.pl  |  2 +-
src/bin/pg_verifybackup/t/007_wal.pl   |  2 +-
src/bin/pgbench/t/001_pgbench_with_server.pl   |  2 +-
src/bin/psql/t/010_tab_completion.pl   |  2 +-
src/bin/scripts/t/010_clusterdb.pl |  2 +-
src/bin/scripts/t/011_clusterdb_all.pl |  2 +-
src/bin/scripts/t/020_createdb.pl  |  2 +-
src/bin/scripts/t/040_createuser.pl|  2 +-
src/bin/scripts/t/050_dropdb.pl|  2 +-
src/bin/scripts/t/070_dropuser.pl  |  2 +-
src/bin/scripts/t/080_pg_isready.pl|  2 +-
src/bin/scripts/t/090_reindexdb.pl |  2 +-
src/bin/scripts/t/091_reindexdb_all.pl |  2 +-
src/bin/scripts/t/100_vacuumdb.pl  |  2 +-
src/bin/scripts/t/101_vacuumdb_all.pl  |  2 +-
src/bin/scripts/t/102_vacuumdb_stages.pl   |  2 +-
src/bin/scripts/t/200_connstr.pl   |  2 +-
src/test/authentication/t/001_password.pl  |  2 +-
src/test/authentication/t/002_saslprep.pl  |  2 +-
src/test/kerberos/t/001_auth.pl|  2 +-
src/test/ldap/t/001_auth.pl|  2 +-
src/test/modules/brin/t/01_workitems.pl|  2 +-
src/test/modules/commit_ts/t/001_base.pl   |  2 +-
src/test/modules/commit_ts/t/002_standby.pl|  4 +-
src/test/modules/commit_ts/t/003_standby_2.pl  |  4 +-
src/test/modules/commit_ts/t/004_restart.pl|  2 +-
.../modules/libpq_pipeline/t/001_libpq_pipeline.pl |  2 +-
.../ssl_passphrase_callback/t/001_testfunc.pl  |  2 +-
.../test_misc/t/001_constraint_validation.pl   |  2 +-
src/test/modules/test_pg_dump/t/001_base.pl|  2 +-
src/test/perl/PostgresNode.pm  | 80 --
src/test/perl/README   |  2 +-
src/test/recovery/t/001_stream_rep.pl  |  6 +-
src/test/recovery/t/002_archiving.pl   |  6 +-
src/test/recovery/t/003_recovery_targets.pl|  8 +--
src/test/recovery/t/004_timeline_switch.pl | 10 +--
src/test/recovery/t/005_replay_delay.pl|  6 +-
src/test/recovery/t/006_logical_decoding.pl|  2 +-
src/test/recovery/t/007_sync_rep.pl| 10 +--
src/test/recovery/t/008_fsm_truncation.pl  |  4 +-
src/test/recovery/t/009_twophase.pl|  4 +-
.../recovery/t/010_logical_decoding_timelines.pl   |  4 +-
src/test/recovery/t/011_crash_recovery.pl  |  2 +-
src/test/recovery/t/012_subtransactions.pl |  4 +-
src/test/recovery/t/013_crash_restart.pl   |  2 +-
src/test/recovery/t/014_unlogged_reinit.pl |  2 +-
src/test/recovery/t/015_promotion_pages.pl |  4 +-
src/test/recovery/t/016_min_consistency.pl   

pgsql: Add a getter function for a PostgresNode install_path

2021-07-29 Thread Andrew Dunstan
Add a getter function for a PostgresNode install_path

Experience has shown this can be useful, and while not strictly necessary
we should not normally expose the internals of PostgresNode objects.

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/87076c40834c2971f073f69be33a5f95ffa8f8a1

Modified Files
--
src/test/perl/PostgresNode.pm | 14 ++
1 file changed, 14 insertions(+)



pgsql: Add PostgresVersion.pm method to emit the major version string

2021-07-29 Thread Andrew Dunstan
Add PostgresVersion.pm method to emit the major version string

For versions before 10, this will produce dotted notation unless a
separator argument is given, in which case it is used.

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/1e8d89f8800e0aaafc66e87e8e5fedf5dbd038cf

Modified Files
--
src/test/perl/PostgresVersion.pm | 28 
1 file changed, 28 insertions(+)



pgsql: Remove unused directory from test/ssl .gitignore

2021-07-29 Thread Daniel Gustafsson
Remove unused directory from test/ssl .gitignore

The clientside log saved from the testrun was removed in 1caef31d9
but the entry in the .gitignore file remained.  While this exists
in older branches as well, it's mostly a cosmetical fix so no back-
patching is done.

Reviewed-by: Michael Paquier
Discussion: https://postgr.es/m/[email protected]

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/454ae15d10ea2d11669b69e82c98fbd03126fd69

Modified Files
--
src/test/ssl/.gitignore | 1 -
1 file changed, 1 deletion(-)



pgsql: Refactor to make common functions in proto.c and worker.c.

2021-07-29 Thread Amit Kapila
Refactor to make common functions in proto.c and worker.c.

This is a non-functional change only to refactor code to extract some
replication logic into static functions.

This is done as preparation for the 2PC streaming patch which also shares
this common logic.

Author: Peter Smith
Reviewed-By: Amit Kapila
Discussion: 
https://postgr.es/m/cahut+puisa8ailce2n5stzsks46sqep_vdoud5fx2xcvtfz...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/91f9861242cd7dcf28fae216b1d8b47551c9159d

Modified Files
--
src/backend/replication/logical/proto.c  |  42 ++---
src/backend/replication/logical/worker.c | 101 +++
2 files changed, 95 insertions(+), 48 deletions(-)



pgsql: Avoid calling TestLib::perl2host on a symlinked directory

2021-07-29 Thread Andrew Dunstan
Avoid calling TestLib::perl2host on a symlinked directory

Certain versions of msys2/Windows have been observed to resolve symlinks
in perl2host rather than just follow them. This defeats using a
symlinked shorter path to a longer path, and makes certain tests fail.
We therefore call perl2host on the parent directory of the symlink and
thereafter just use that result.

Apply to release 14 where the problem has been observed.

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/b35a67bc04243da609843949c53e6841e748243a

Modified Files
--
src/bin/pg_basebackup/t/010_pg_basebackup.pl | 12 +++-
1 file changed, 7 insertions(+), 5 deletions(-)



pgsql: Make TestLib::perl2host more consistent and robust

2021-07-29 Thread Andrew Dunstan
Make TestLib::perl2host more consistent and robust

Sometimes cygpath has been observed to return a path with a trailing
slash. That can cause problems, Also, make "cygpath" usage
consistent with "pwd -W" with respect to the use of forward slashes.

Backpatch to release 14 where the current code was introduced.

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/bad106752272c05de5a56036b8a84ae6ff3249a0

Modified Files
--
src/test/perl/TestLib.pm | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)



pgsql: Make TestLib::perl2host more consistent and robust

2021-07-29 Thread Andrew Dunstan
Make TestLib::perl2host more consistent and robust

Sometimes cygpath has been observed to return a path with a trailing
slash. That can cause problems, Also, make "cygpath" usage
consistent with "pwd -W" with respect to the use of forward slashes.

Backpatch to release 14 where the current code was introduced.

Branch
--
REL_14_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/68011e17d098da66070a2d648a609625241f73f6

Modified Files
--
src/test/perl/TestLib.pm | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)



pgsql: Avoid calling TestLib::perl2host on a symlinked directory

2021-07-29 Thread Andrew Dunstan
Avoid calling TestLib::perl2host on a symlinked directory

Certain versions of msys2/Windows have been observed to resolve symlinks
in perl2host rather than just follow them. This defeats using a
symlinked shorter path to a longer path, and makes certain tests fail.
We therefore call perl2host on the parent directory of the symlink and
thereafter just use that result.

Apply to release 14 where the problem has been observed.

Branch
--
REL_14_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/c42d3d04d7d03782ae179bf92ea0eb9f2fa8f409

Modified Files
--
src/bin/pg_basebackup/t/010_pg_basebackup.pl | 12 +++-
1 file changed, 7 insertions(+), 5 deletions(-)



Re: pgsql: Re-enable TAP tests of pg_receivewal for ZLIB on Windows

2021-07-29 Thread Andrew Dunstan


On 7/27/21 2:24 PM, Andrew Dunstan wrote:
> On 7/21/21 9:08 PM, Andrew Dunstan wrote:
>> On 7/21/21 8:00 PM, Michael Paquier wrote:
>>> On Wed, Jul 21, 2021 at 10:05:19AM -0400, Andrew Dunstan wrote:
 drongo, an MSVC animal running on the same machine, doesn't seem to have
 an issue, nor jacana which runs msys1, so this seems possibly
 msys2-specific. I'll investigate on a similar instance I have.
>>> How is doing bowerbird?  I was waiting for it to send an update before
>>> doing anything but there is no report yet.  Is it getting stuck?  I
>>> would feel honestly less sad about those tests if this proves to
>>> require temporarily a $is_msys2 rather than a $windows_os.
>>
>> Yeah, bowerbird got a SIGBREAK that caused the whole buildfarm run to
>> die, so it's even worse than fairywren.
>>
>>
>> Let's skip for $windows_os and do some more thorough investigation.
>>
>>
>
> I have got to the bottom of the issue on fairywren - it was caused by
> using a zlib I had build (and which is used on drongo) rather than the
> mingw64 zlib package. So I've switched that.
>
>
> While doing that I uncovered some more things that need to be fixed for
> portability both in TestLib and the pg_basebackup tests,
>
>
> Meanwhile I will now go and investigate what's happening with bowerbird.



It gets stuck in a loop like this:


ok 19 - one partial WAL segment was created
0/2001968
# Running: pg_receivewal -D 
H:/prog/bf/root/HEAD/pgsql.build/src/bin/pg_basebackup/tmp_check/t_020_pg_receivewal_primary_data/archive_wal
 --verbose --endpos 0/328 --compress 1 
pg_receivewal: starting log streaming at 0/200 (timeline 1)
pg_receivewal: error: could not write 131072 bytes to WAL file 
"00010002": Permission denied
pg_receivewal: error: could not close file "00010002": 
Permission denied
pg_receivewal: disconnected; waiting 5 seconds to try again
pg_receivewal: starting log streaming at 0/200 (timeline 1)
pg_receivewal: error: could not write 131072 bytes to WAL file 
"00010002": Permission denied
pg_receivewal: error: could not close file "00010002": 
Permission denied
pg_receivewal: disconnected; waiting 5 seconds to try again
pg_receivewal: starting log streaming at 0/200 (timeline 1)
pg_receivewal: error: could not write 131072 bytes to WAL file 
"00010002": Permission denied
pg_receivewal: error: could not close file "00010002": 
Permission denied
pg_receivewal: disconnected; waiting 5 seconds to try again
pg_receivewal: starting log streaming at 0/200 (timeline 1)
pg_receivewal: error: could not write 131072 bytes to WAL file 
"00010002": Permission denied
pg_receivewal: error: could not close file "00010002": 
Permission denied
pg_receivewal: disconnected; waiting 5 seconds to try again
pg_receivewal: starting log streaming at 0/200 (timeline 1)
pg_receivewal: error: could not write 131072 bytes to WAL file 
"00010002": Permission denied
pg_receivewal: error: could not close file "00010002": 
Permission denied
pg_receivewal: disconnected; waiting 5 seconds to try again


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com





pgsql: Improve libpq's handling of OOM during error message constructio

2021-07-29 Thread Tom Lane
Improve libpq's handling of OOM during error message construction.

Commit ffa2e4670 changed libpq so that multiple error reports
occurring during one operation (a connection attempt or query)
are accumulated in conn->errorMessage, where before new ones
usually replaced any prior error.  At least in theory, that makes
us more vulnerable to running out of memory for the errorMessage
buffer.  If it did happen, the user would be left with just an
empty-string error report, which is pretty unhelpful.

We can improve this by relying on pqexpbuffer.c's existing "broken
buffer" convention to track whether we've hit OOM for the current
operation's error string, and then substituting a constant "out of
memory" string in the small number of places where the errorMessage
is read out.

While at it, apply the same method to similar OOM cases in
pqInternalNotice and pqGetErrorNotice3.

Back-patch to v14 where ffa2e4670 came in.  In principle this could
go back further; but in view of the lack of field reports, the
hazard seems negligible in older branches.

Discussion: https://postgr.es/m/[email protected]

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/514b4c11d24701d2cc90ad75ed787bf1380af673

Modified Files
--
src/interfaces/libpq/fe-connect.c   |  8 +++
src/interfaces/libpq/fe-exec.c  | 42 -
src/interfaces/libpq/fe-protocol3.c | 15 +
src/interfaces/libpq/libpq-int.h|  2 +-
4 files changed, 48 insertions(+), 19 deletions(-)



pgsql: Improve libpq's handling of OOM during error message constructio

2021-07-29 Thread Tom Lane
Improve libpq's handling of OOM during error message construction.

Commit ffa2e4670 changed libpq so that multiple error reports
occurring during one operation (a connection attempt or query)
are accumulated in conn->errorMessage, where before new ones
usually replaced any prior error.  At least in theory, that makes
us more vulnerable to running out of memory for the errorMessage
buffer.  If it did happen, the user would be left with just an
empty-string error report, which is pretty unhelpful.

We can improve this by relying on pqexpbuffer.c's existing "broken
buffer" convention to track whether we've hit OOM for the current
operation's error string, and then substituting a constant "out of
memory" string in the small number of places where the errorMessage
is read out.

While at it, apply the same method to similar OOM cases in
pqInternalNotice and pqGetErrorNotice3.

Back-patch to v14 where ffa2e4670 came in.  In principle this could
go back further; but in view of the lack of field reports, the
hazard seems negligible in older branches.

Discussion: https://postgr.es/m/[email protected]

Branch
--
REL_14_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/43f1d2ab361ccbd5ba8b53578fd4bcea9a6344a6

Modified Files
--
src/interfaces/libpq/fe-connect.c   |  8 +++
src/interfaces/libpq/fe-exec.c  | 42 -
src/interfaces/libpq/fe-protocol3.c | 15 +
src/interfaces/libpq/libpq-int.h|  2 +-
4 files changed, 48 insertions(+), 19 deletions(-)



pgsql: docs: Fix bit_count example output

2021-07-29 Thread Daniel Gustafsson
docs: Fix bit_count example output

The returnvalue for the bit_count(::bytea) example was assuming a
non-default value of standard_conforming_strings.  This was fixed
in the tests in commit ebedd0c78.

Author: [email protected]
Discussion: 
https://postgr.es/m/oszpr01mb6551ffac1088c82c3d799be0fa...@oszpr01mb6551.jpnprd01.prod.outlook.com
Backpatch-through: 14

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/fcf4c0ae1db8594cf3d3e84d2564616497eecd5a

Modified Files
--
doc/src/sgml/func.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



pgsql: docs: Fix bit_count example output

2021-07-29 Thread Daniel Gustafsson
docs: Fix bit_count example output

The returnvalue for the bit_count(::bytea) example was assuming a
non-default value of standard_conforming_strings.  This was fixed
in the tests in commit ebedd0c78.

Author: [email protected]
Discussion: 
https://postgr.es/m/oszpr01mb6551ffac1088c82c3d799be0fa...@oszpr01mb6551.jpnprd01.prod.outlook.com
Backpatch-through: 14

Branch
--
REL_14_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/c73bba23ef07f88ce3860a06bbf56180e00b185d

Modified Files
--
doc/src/sgml/func.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



pgsql: Close yet another race condition in replication slot test code

2021-07-29 Thread Alvaro Herrera
Close yet another race condition in replication slot test code

Buildfarm shows that this test has a further failure mode when a
checkpoint starts earlier than expected, so we detect a "checkpoint
completed" line that's not the one we want.  Change the config to try
and prevent this.

Per buildfarm

While at it, update one comment that was forgotten in commit
d18e75664a2f.

Author: Kyotaro Horiguchi 
Discussion: 
https://postgr.es/m/[email protected]

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/ce197e91d02ca38ac1b956a3e0c11596099e7893

Modified Files
--
src/backend/access/transam/xlog.c |  2 +-
src/test/recovery/t/019_replslot_limit.pl | 14 --
2 files changed, 13 insertions(+), 3 deletions(-)



pgsql: Close yet another race condition in replication slot test code

2021-07-29 Thread Alvaro Herrera
Close yet another race condition in replication slot test code

Buildfarm shows that this test has a further failure mode when a
checkpoint starts earlier than expected, so we detect a "checkpoint
completed" line that's not the one we want.  Change the config to try
and prevent this.

Per buildfarm

While at it, update one comment that was forgotten in commit
d18e75664a2f.

Author: Kyotaro Horiguchi 
Discussion: 
https://postgr.es/m/[email protected]

Branch
--
REL_14_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/f951f6f69c7e77acdd04776168126f00e269dcfb

Modified Files
--
src/backend/access/transam/xlog.c |  2 +-
src/test/recovery/t/019_replslot_limit.pl | 14 --
2 files changed, 13 insertions(+), 3 deletions(-)



Re: pgsql: Close yet another race condition in replication slot test code

2021-07-29 Thread Tom Lane
Alvaro Herrera  writes:
> Close yet another race condition in replication slot test code

Shouldn't that have gone into v13, too?

regards, tom lane




Re: pgsql: Close yet another race condition in replication slot test code

2021-07-29 Thread Alvaro Herrera
On 2021-Jul-29, Tom Lane wrote:

> Alvaro Herrera  writes:
> > Close yet another race condition in replication slot test code
> 
> Shouldn't that have gone into v13, too?

Oh, oops, yeah, I confused how recent this feature is.  Will do in a
minute.

-- 
Álvaro Herrera   39°49'30"S 73°17'W  —  https://www.EnterpriseDB.com/
"Always assume the user will do much worse than the stupidest thing
you can imagine."(Julien PUYDT)




pgsql: Close yet another race condition in replication slot test code

2021-07-29 Thread Alvaro Herrera
Close yet another race condition in replication slot test code

Buildfarm shows that this test has a further failure mode when a
checkpoint starts earlier than expected, so we detect a "checkpoint
completed" line that's not the one we want.  Change the config to try
and prevent this.

Per buildfarm

Author: Kyotaro Horiguchi 
Discussion: 
https://postgr.es/m/[email protected]

Branch
--
REL_13_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/41d27ee7b870c1a1213704d3c020a01eb55799b0

Modified Files
--
src/test/recovery/t/019_replslot_limit.pl | 14 --
1 file changed, 12 insertions(+), 2 deletions(-)



Re: pgsql: Re-enable TAP tests of pg_receivewal for ZLIB on Windows

2021-07-29 Thread Michael Paquier
On Thu, Jul 29, 2021 at 01:26:22PM -0400, Andrew Dunstan wrote:
> It gets stuck in a loop like this:
> 
> ok 19 - one partial WAL segment was created
> 0/2001968
> # Running: pg_receivewal -D 
> H:/prog/bf/root/HEAD/pgsql.build/src/bin/pg_basebackup/tmp_check/t_020_pg_receivewal_primary_data/archive_wal
>  --verbose --endpos 0/328 --compress 1 
> pg_receivewal: starting log streaming at 0/200 (timeline 1)
> pg_receivewal: error: could not write 131072 bytes to WAL file 
> "00010002": Permission denied
> pg_receivewal: error: could not close file "00010002": 
> Permission denied
> pg_receivewal: disconnected; waiting 5 seconds to try again

Hmm.  This error is strange.  Still, it is an oversight of ffc9ddae to
not use --no-loop here for the two new commands of pg_receivewal
--endpos.  Please see the attached.
--
Michael
diff --git a/src/bin/pg_basebackup/t/020_pg_receivewal.pl b/src/bin/pg_basebackup/t/020_pg_receivewal.pl
index 65076d6632..463dddbca8 100644
--- a/src/bin/pg_basebackup/t/020_pg_receivewal.pl
+++ b/src/bin/pg_basebackup/t/020_pg_receivewal.pl
@@ -93,7 +93,8 @@ SKIP:
 	$primary->command_ok(
 		[
 			'pg_receivewal', '-D', $stream_dir,  '--verbose',
-			'--endpos',  $nextlsn, '--compress', '1 '
+			'--endpos',  $nextlsn, '--compress', '1 ',
+			'--no-loop'
 		],
 		"streaming some WAL using ZLIB compression");
 
@@ -138,7 +139,10 @@ chomp($nextlsn);
 $primary->psql('postgres',
 	'INSERT INTO test_table VALUES (generate_series(200,300));');
 $primary->command_ok(
-	[ 'pg_receivewal', '-D', $stream_dir, '--verbose', '--endpos', $nextlsn ],
+	[
+		'pg_receivewal', '-D', $stream_dir, '--verbose',
+		'--endpos',  $nextlsn, '--no-loop'
+	],
 	"streaming some WAL");
 
 $partial_wals[0] =~ s/(\.gz)?.partial//;


signature.asc
Description: PGP signature


pgsql: Remove unused argument in apply_handle_commit_internal().

2021-07-29 Thread Amit Kapila
Remove unused argument in apply_handle_commit_internal().

Oversight in commit 0926e96c49.

Author: Masahiko Sawada
Reviewed-By: Amit Kapila
Backpatch-through: 14, where it was introduced
Discussion: 
https://postgr.es/m/CAD21AoDeScrsHhLyEPYqN3sydg6PxAPVBboK=30xjfuvihn...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/16bd4becee32240d09db5c6cbec87957fdfcd2d9

Modified Files
--
src/backend/replication/logical/worker.c | 9 -
1 file changed, 4 insertions(+), 5 deletions(-)



pgsql: Remove unused argument in apply_handle_commit_internal().

2021-07-29 Thread Amit Kapila
Remove unused argument in apply_handle_commit_internal().

Oversight in commit 0926e96c49.

Author: Masahiko Sawada
Reviewed-By: Amit Kapila
Backpatch-through: 14, where it was introduced
Discussion: 
https://postgr.es/m/CAD21AoDeScrsHhLyEPYqN3sydg6PxAPVBboK=30xjfuvihn...@mail.gmail.com

Branch
--
REL_14_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/f4b939f1a3720209e1941b88e11e02ea5e671c1b

Modified Files
--
src/backend/replication/logical/worker.c | 9 -
1 file changed, 4 insertions(+), 5 deletions(-)