pgsql: Improve log pattern detection in recently-added TAP tests

2021-06-11 Thread Michael Paquier
Improve log pattern detection in recently-added TAP tests ab55d74 has introduced some tests with rows found as missing in logical replication subscriptions for partitioned tables, relying on a logic with a lookup of the logs generated, scanning the whole file. This commit makes the logic more pre

pgsql: Improve log pattern detection in recently-added TAP tests

2021-06-11 Thread Michael Paquier
Improve log pattern detection in recently-added TAP tests ab55d74 has introduced some tests with rows found as missing in logical replication subscriptions for partitioned tables, relying on a logic with a lookup of the logs generated, scanning the whole file. This commit makes the logic more pre

pgsql: Improve and cleanup ProcArrayAdd(), ProcArrayRemove().

2021-06-11 Thread Andres Freund
Improve and cleanup ProcArrayAdd(), ProcArrayRemove(). 941697c3c1a changed ProcArrayAdd()/Remove() substantially. As reported by zhanyi, I missed that due to the introduction of the PGPROC->pgxactoff ProcArrayRemove() does not need to search for the position in procArray->pgprocnos anymore - that'

pgsql: Remove PGSSLCRLDIR from the list of variables ignored in TAP tes

2021-06-11 Thread Michael Paquier
Remove PGSSLCRLDIR from the list of variables ignored in TAP tests This variable was present in the list added by 9d660670, but it is not supported by this branch. Issue noticed while diving into a similar change for pg_regress.c. Backpatch-through: 9.6 Branch -- REL_11_STABLE Details

pgsql: Remove PGSSLCRLDIR from the list of variables ignored in TAP tes

2021-06-11 Thread Michael Paquier
Remove PGSSLCRLDIR from the list of variables ignored in TAP tests This variable was present in the list added by 9d660670, but it is not supported by this branch. Issue noticed while diving into a similar change for pg_regress.c. Backpatch-through: 9.6 Branch -- REL_12_STABLE Details

pgsql: Remove PGSSLCRLDIR from the list of variables ignored in TAP tes

2021-06-11 Thread Michael Paquier
Remove PGSSLCRLDIR from the list of variables ignored in TAP tests This variable was present in the list added by 9d660670, but it is not supported by this branch. Issue noticed while diving into a similar change for pg_regress.c. Backpatch-through: 9.6 Branch -- REL9_6_STABLE Details

pgsql: Remove PGSSLCRLDIR from the list of variables ignored in TAP tes

2021-06-11 Thread Michael Paquier
Remove PGSSLCRLDIR from the list of variables ignored in TAP tests This variable was present in the list added by 9d660670, but it is not supported by this branch. Issue noticed while diving into a similar change for pg_regress.c. Backpatch-through: 9.6 Branch -- REL_13_STABLE Details

pgsql: Remove PGSSLCRLDIR from the list of variables ignored in TAP tes

2021-06-11 Thread Michael Paquier
Remove PGSSLCRLDIR from the list of variables ignored in TAP tests This variable was present in the list added by 9d660670, but it is not supported by this branch. Issue noticed while diving into a similar change for pg_regress.c. Backpatch-through: 9.6 Branch -- REL_10_STABLE Details

pgsql: doc: remove extra right angle bracket in PG 14 relnotes

2021-06-11 Thread Bruce Momjian
doc: remove extra right angle bracket in PG 14 relnotes Reported-by: Justin Pryzby Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/d120e66fac87f768ea2289d2d923d0ee4262ec0f Modified Files -- doc/src/sgml/release-14.sgml | 2 +- 1 file changed, 1 insertio

pgsql: docs: fix incorrect indenting in PG 14 relnotes

2021-06-11 Thread Bruce Momjian
docs: fix incorrect indenting in PG 14 relnotes Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/0725913982e5e06895a32a9eeea2c59a13978927 Modified Files -- doc/src/sgml/release-14.sgml | 130 +-- 1 file changed, 65

pgsql: Report sort phase progress in parallel btree build

2021-06-11 Thread Alvaro Herrera
Report sort phase progress in parallel btree build We were already reporting it, but only after the parallel workers were finished, which is visibly much later than what happens in a serial build. With this change we report it when the leader starts its own sort phase when participating in the bu

pgsql: Report sort phase progress in parallel btree build

2021-06-11 Thread Alvaro Herrera
Report sort phase progress in parallel btree build We were already reporting it, but only after the parallel workers were finished, which is visibly much later than what happens in a serial build. With this change we report it when the leader starts its own sort phase when participating in the bu

pgsql: Report sort phase progress in parallel btree build

2021-06-11 Thread Alvaro Herrera
Report sort phase progress in parallel btree build We were already reporting it, but only after the parallel workers were finished, which is visibly much later than what happens in a serial build. With this change we report it when the leader starts its own sort phase when participating in the bu

pgsql: Fix multiple crasher bugs in partitioned-table replication logic

2021-06-11 Thread Tom Lane
Fix multiple crasher bugs in partitioned-table replication logic. apply_handle_tuple_routing(), having detected and reported that the tuple it needed to update didn't exist, tried to update that tuple anyway, leading to a null-pointer dereference. logicalrep_partition_open() failed to ensure that

pgsql: Fix multiple crasher bugs in partitioned-table replication logic

2021-06-11 Thread Tom Lane
Fix multiple crasher bugs in partitioned-table replication logic. apply_handle_tuple_routing(), having detected and reported that the tuple it needed to update didn't exist, tried to update that tuple anyway, leading to a null-pointer dereference. logicalrep_partition_open() failed to ensure that

pgsql: Add 'Portal Close' message to pipelined PQsendQuery()

2021-06-11 Thread Alvaro Herrera
Add 'Portal Close' message to pipelined PQsendQuery() Commit acb7e4eb6b1c added a new implementation for PQsendQuery so that it works in pipeline mode (by using extended query protocol), but it behaves differently from the 'Q' message (in simple query protocol) used by regular implementation: the

pgsql: Return ReplicationSlotAcquire API to its original form

2021-06-11 Thread Alvaro Herrera
Return ReplicationSlotAcquire API to its original form Per 96540f80f833; the awkward API introduced by c6550776394e is no longer needed. Author: Andres Freund Reviewed-by: Álvaro Herrera Discussion: https://postgr.es/m/[email protected] Branch -- master De

pgsql: Optimize creation of slots for FDW bulk inserts

2021-06-11 Thread Tomas Vondra
Optimize creation of slots for FDW bulk inserts Commit b663a41363 introduced bulk inserts for FDW, but the handling of tuple slots turned out to be problematic for two reasons. Firstly, the slots were re-created for each individual batch. Secondly, all slots referenced the same tuple descriptor -

pgsql: Fix race condition in invalidating obsolete replication slots

2021-06-11 Thread Alvaro Herrera
Fix race condition in invalidating obsolete replication slots The code added to mark replication slots invalid in commit c6550776394e had the race condition that a slot can be dropped or advanced concurrently with checkpointer trying to invalidate it. Rewrite the code to close those races. The c

pgsql: Fix race condition in invalidating obsolete replication slots

2021-06-11 Thread Alvaro Herrera
Fix race condition in invalidating obsolete replication slots The code added to mark replication slots invalid in commit c6550776394e had the race condition that a slot can be dropped or advanced concurrently with checkpointer trying to invalidate it. Rewrite the code to close those races. The c