pgsql: Prevent race condition while reading relmapper file.

2021-06-24 Thread Heikki Linnakangas
Prevent race condition while reading relmapper file. Contrary to the comment here, POSIX does not guarantee atomicity of a read(), if another process calls write() concurrently. Or at least Linux does not. Add locking to load_relmap_file() to avoid the race condition. Fixes bug #17064. Thanks to

pgsql: Prevent race condition while reading relmapper file.

2021-06-24 Thread Heikki Linnakangas
Prevent race condition while reading relmapper file. Contrary to the comment here, POSIX does not guarantee atomicity of a read(), if another process calls write() concurrently. Or at least Linux does not. Add locking to load_relmap_file() to avoid the race condition. Fixes bug #17064. Thanks to

pgsql: Prevent race condition while reading relmapper file.

2021-06-24 Thread Heikki Linnakangas
Prevent race condition while reading relmapper file. Contrary to the comment here, POSIX does not guarantee atomicity of a read(), if another process calls write() concurrently. Or at least Linux does not. Add locking to load_relmap_file() to avoid the race condition. Fixes bug #17064. Thanks to

pgsql: Prevent race condition while reading relmapper file.

2021-06-24 Thread Heikki Linnakangas
Prevent race condition while reading relmapper file. Contrary to the comment here, POSIX does not guarantee atomicity of a read(), if another process calls write() concurrently. Or at least Linux does not. Add locking to load_relmap_file() to avoid the race condition. Fixes bug #17064. Thanks to

pgsql: Prevent race condition while reading relmapper file.

2021-06-24 Thread Heikki Linnakangas
Prevent race condition while reading relmapper file. Contrary to the comment here, POSIX does not guarantee atomicity of a read(), if another process calls write() concurrently. Or at least Linux does not. Add locking to load_relmap_file() to avoid the race condition. Fixes bug #17064. Thanks to

pgsql: Prevent race condition while reading relmapper file.

2021-06-24 Thread Heikki Linnakangas
Prevent race condition while reading relmapper file. Contrary to the comment here, POSIX does not guarantee atomicity of a read(), if another process calls write() concurrently. Or at least Linux does not. Add locking to load_relmap_file() to avoid the race condition. Fixes bug #17064. Thanks to

pgsql: Another fix to relmapper race condition.

2021-06-24 Thread Heikki Linnakangas
Another fix to relmapper race condition. In previous commit, I missed that relmap_redo() was also not acquiring the RelationMappingLock. Thanks to Thomas Munro for pointing that out. Backpatch-through: 9.6, like previous commit. Discussion: https://www.postgresql.org/message-id/CA%2BhUKGLev%3DPp

pgsql: Another fix to relmapper race condition.

2021-06-24 Thread Heikki Linnakangas
Another fix to relmapper race condition. In previous commit, I missed that relmap_redo() was also not acquiring the RelationMappingLock. Thanks to Thomas Munro for pointing that out. Backpatch-through: 9.6, like previous commit. Discussion: https://www.postgresql.org/message-id/CA%2BhUKGLev%3DPp

pgsql: Another fix to relmapper race condition.

2021-06-24 Thread Heikki Linnakangas
Another fix to relmapper race condition. In previous commit, I missed that relmap_redo() was also not acquiring the RelationMappingLock. Thanks to Thomas Munro for pointing that out. Backpatch-through: 9.6, like previous commit. Discussion: https://www.postgresql.org/message-id/CA%2BhUKGLev%3DPp

pgsql: Another fix to relmapper race condition.

2021-06-24 Thread Heikki Linnakangas
Another fix to relmapper race condition. In previous commit, I missed that relmap_redo() was also not acquiring the RelationMappingLock. Thanks to Thomas Munro for pointing that out. Backpatch-through: 9.6, like previous commit. Discussion: https://www.postgresql.org/message-id/CA%2BhUKGLev%3DPp

pgsql: Another fix to relmapper race condition.

2021-06-24 Thread Heikki Linnakangas
Another fix to relmapper race condition. In previous commit, I missed that relmap_redo() was also not acquiring the RelationMappingLock. Thanks to Thomas Munro for pointing that out. Backpatch-through: 9.6, like previous commit. Discussion: https://www.postgresql.org/message-id/CA%2BhUKGLev%3DPp

pgsql: Another fix to relmapper race condition.

2021-06-24 Thread Heikki Linnakangas
Another fix to relmapper race condition. In previous commit, I missed that relmap_redo() was also not acquiring the RelationMappingLock. Thanks to Thomas Munro for pointing that out. Backpatch-through: 9.6, like previous commit. Discussion: https://www.postgresql.org/message-id/CA%2BhUKGLev%3DPp

pgsql: Fix ABI break introduced by commit 4daa140a2f.

2021-06-24 Thread Amit Kapila
Fix ABI break introduced by commit 4daa140a2f. Move the newly defined enum value REORDER_BUFFER_CHANGE_INTERNAL_SPEC_ABORT at the end to avoid ABI break in the back branches. We need to back-patch this till v11 because before that it is already at the end. Reported-by: Tomas Vondra Backpatch-thro

pgsql: Fix ABI break introduced by commit 4daa140a2f.

2021-06-24 Thread Amit Kapila
Fix ABI break introduced by commit 4daa140a2f. Move the newly defined enum value REORDER_BUFFER_CHANGE_INTERNAL_SPEC_ABORT at the end to avoid ABI break in the back branches. We need to back-patch this till v11 because before that it is already at the end. Reported-by: Tomas Vondra Backpatch-thro

pgsql: Fix ABI break introduced by commit 4daa140a2f.

2021-06-24 Thread Amit Kapila
Fix ABI break introduced by commit 4daa140a2f. Move the newly defined enum value REORDER_BUFFER_CHANGE_INTERNAL_SPEC_ABORT at the end to avoid ABI break in the back branches. We need to back-patch this till v11 because before that it is already at the end. Reported-by: Tomas Vondra Backpatch-thro

pgsql: Stabilize results of insert-conflict-toast.spec.

2021-06-24 Thread Tom Lane
Stabilize results of insert-conflict-toast.spec. This back-branch test script was later absorbed into insert-conflict-specconflict.spec, which required some stabilization in commit 741d7f104, so perhaps it's not surprising that it needs a bit of love too. It's odd though that we hadn't seen it fa

pgsql: Stabilize results of insert-conflict-toast.spec.

2021-06-24 Thread Tom Lane
Stabilize results of insert-conflict-toast.spec. This back-branch test script was later absorbed into insert-conflict-specconflict.spec, which required some stabilization in commit 741d7f104, so perhaps it's not surprising that it needs a bit of love too. It's odd though that we hadn't seen it fa

pgsql: Stabilize results of insert-conflict-toast.spec.

2021-06-24 Thread Tom Lane
Stabilize results of insert-conflict-toast.spec. This back-branch test script was later absorbed into insert-conflict-specconflict.spec, which required some stabilization in commit 741d7f104, so perhaps it's not surprising that it needs a bit of love too. It's odd though that we hadn't seen it fa

pgsql: Stabilize results of insert-conflict-toast.spec.

2021-06-24 Thread Tom Lane
Stabilize results of insert-conflict-toast.spec. This back-branch test script was later absorbed into insert-conflict-specconflict.spec, which required some stabilization in commit 741d7f104, so perhaps it's not surprising that it needs a bit of love too. It's odd though that we hadn't seen it fa

pgsql: Further stabilize postgres_fdw test.

2021-06-24 Thread Tom Lane
Further stabilize postgres_fdw test. The queries involving ft1_nopw don't stably return the same row anymore. I surmise that an autovacuum hitting "S 1"."T 1" right after the updates introduced by f61db909d/5843659d0 freed some space, changing where subsequent insertions get stored. It's only by

pgsql: Fix pattern matching logic for logs in TAP tests of pgbench

2021-06-24 Thread Michael Paquier
Fix pattern matching logic for logs in TAP tests of pgbench The logic checking for the format of per-thread logs used grep() with directly "$re", which would cause the test to consider all the logs as a match without caring about their format at all. Using "/$re/" makes grep() perform a regex tes

pgsql: Fix pattern matching logic for logs in TAP tests of pgbench

2021-06-24 Thread Michael Paquier
Fix pattern matching logic for logs in TAP tests of pgbench The logic checking for the format of per-thread logs used grep() with directly "$re", which would cause the test to consider all the logs as a match without caring about their format at all. Using "/$re/" makes grep() perform a regex tes

pgsql: Fix pattern matching logic for logs in TAP tests of pgbench

2021-06-24 Thread Michael Paquier
Fix pattern matching logic for logs in TAP tests of pgbench The logic checking for the format of per-thread logs used grep() with directly "$re", which would cause the test to consider all the logs as a match without caring about their format at all. Using "/$re/" makes grep() perform a regex tes

pgsql: Fix pattern matching logic for logs in TAP tests of pgbench

2021-06-24 Thread Michael Paquier
Fix pattern matching logic for logs in TAP tests of pgbench The logic checking for the format of per-thread logs used grep() with directly "$re", which would cause the test to consider all the logs as a match without caring about their format at all. Using "/$re/" makes grep() perform a regex tes

Ubuntu 14.04 (trusty) Postgres 13 deb package

2021-06-24 Thread Bhavesh Mistry
Hi All, I was trying to install PSQL 13 on Ubuntu 14.04 (trusty) but I could not find the package. It seems the path has been removed. Can you please tell me how to build deb package for trusty from psql source? I tried psql 13 sources, I was able to build but I could not figure out how to buil

Re: Ubuntu 14.04 (trusty) Postgres 13 deb package

2021-06-24 Thread Thomas Munro
On Fri, Jun 25, 2021 at 9:57 AM Bhavesh Mistry wrote: > I was trying to install PSQL 13 on Ubuntu 14.04 (trusty) but I could not > find the package. It seems the path has been removed. Can you please tell > me how to build deb package for trusty from psql source? I tried psql 13 > sources, I

Re: Ubuntu 14.04 (trusty) Postgres 13 deb package

2021-06-24 Thread Thomas Munro
On Fri, Jun 25, 2021 at 10:06 AM Thomas Munro wrote: > pgsql-hackers (Oops, I meant to write pgsql-general).

pgsql: Prepare for forthcoming LLVM 13 API change.

2021-06-24 Thread Thomas Munro
Prepare for forthcoming LLVM 13 API change. LLVM 13 (due out in September) has changed the semantics of LLVMOrcAbsoluteSymbols(), so we need to bump some reference counts to avoid a double-free that causes crashes and bad query results. A proactive change seems necessary to avoid having a window

pgsql: Prepare for forthcoming LLVM 13 API change.

2021-06-24 Thread Thomas Munro
Prepare for forthcoming LLVM 13 API change. LLVM 13 (due out in September) has changed the semantics of LLVMOrcAbsoluteSymbols(), so we need to bump some reference counts to avoid a double-free that causes crashes and bad query results. A proactive change seems necessary to avoid having a window

pgsql: Prepare for forthcoming LLVM 13 API change.

2021-06-24 Thread Thomas Munro
Prepare for forthcoming LLVM 13 API change. LLVM 13 (due out in September) has changed the semantics of LLVMOrcAbsoluteSymbols(), so we need to bump some reference counts to avoid a double-free that causes crashes and bad query results. A proactive change seems necessary to avoid having a window

pgsql: Prepare for forthcoming LLVM 13 API change.

2021-06-24 Thread Thomas Munro
Prepare for forthcoming LLVM 13 API change. LLVM 13 (due out in September) has changed the semantics of LLVMOrcAbsoluteSymbols(), so we need to bump some reference counts to avoid a double-free that causes crashes and bad query results. A proactive change seems necessary to avoid having a window

pgsql: doc: Move remove_temp_files_after_crash to section for developer

2021-06-24 Thread Michael Paquier
doc: Move remove_temp_files_after_crash to section for developer options The main goal of this option is to allow inspecting temporary files for debugging purposes, so moving the parameter there is natural. Oversight in cd91de0. Reported-by: Justin Pryzby Author: Euler Taveira Discussion: https:

Re: pgsql: Fix pattern matching logic for logs in TAP tests of pgbench

2021-06-24 Thread Michael Paquier
On Thu, Jun 24, 2021 at 09:54:51PM +, Michael Paquier wrote: > Fix pattern matching logic for logs in TAP tests of pgbench > > The logic checking for the format of per-thread logs used grep() with > directly "$re", which would cause the test to consider all the logs as > a match without caring

Re: pgsql: Fix pattern matching logic for logs in TAP tests of pgbench

2021-06-24 Thread Michael Paquier
(Forgot to add Andrew in CC, now done) On Fri, Jun 25, 2021 at 08:51:19AM +0900, Michael Paquier wrote: > Andrew, what's the format of the per-thread logs generated on this > host when running the commands? I'd bet that the checks for the > client IDs are right, but that some parts of the regex a

pgsql: Add more debugging information with log checks in TAP tests of p

2021-06-24 Thread Michael Paquier
Add more debugging information with log checks in TAP tests of pgbench fairywren is not happy with the pattern checks introduced by c13585f. I am not sure if this outlines a bug in pgbench or if the regex patterns used in the tests are too restrictive for this buildfarm member's environment. This

Re: pgsql: Fix pattern matching logic for logs in TAP tests of pgbench

2021-06-24 Thread Andrew Dunstan
On 6/24/21 8:26 PM, Michael Paquier wrote: > (Forgot to add Andrew in CC, now done) > > On Fri, Jun 25, 2021 at 08:51:19AM +0900, Michael Paquier wrote: >> Andrew, what's the format of the per-thread logs generated on this >> host when running the commands? I'd bet that the checks for the >> cli

Re: pgsql: Fix pattern matching logic for logs in TAP tests of pgbench

2021-06-24 Thread Michael Paquier
On Thu, Jun 24, 2021 at 09:36:53PM -0400, Andrew Dunstan wrote: > That's not really an equivalent test. I'm taking a look Thanks! -- Michael signature.asc Description: PGP signature

Re: pgsql: Fix pattern matching logic for logs in TAP tests of pgbench

2021-06-24 Thread Andrew Dunstan
On 6/24/21 9:53 PM, Michael Paquier wrote: > On Thu, Jun 24, 2021 at 09:36:53PM -0400, Andrew Dunstan wrote: >> That's not really an equivalent test. I'm taking a look > Thanks! There's a whole lot wrong with this code. To start with, why is that unchecked eval there. And why is it reading in

Re: pgsql: Fix pattern matching logic for logs in TAP tests of pgbench

2021-06-24 Thread Andrew Dunstan
On 6/24/21 10:12 PM, Andrew Dunstan wrote: > On 6/24/21 9:53 PM, Michael Paquier wrote: >> On Thu, Jun 24, 2021 at 09:36:53PM -0400, Andrew Dunstan wrote: >>> That's not really an equivalent test. I'm taking a look >> Thanks! > > > > There's a whole lot wrong with this code. To start with, why is

pgsql: doc: Add acronyms for MITM and SNI

2021-06-24 Thread Michael Paquier
doc: Add acronyms for MITM and SNI This adds MITM and SNI as acronyms, as the documentation already had them marked up with . While on it, make sure to spell man-in-the-middle with dashes consistently, and add acronyms for those new terms where appropriate. Author: Daniel Gustafsson Reviewed-by:

pgsql: Doc: Fix minor formatting issue in logicaldecoding.sgml.

2021-06-24 Thread Amit Kapila
Doc: Fix minor formatting issue in logicaldecoding.sgml. Author: Guillaume Lelarge Discussion: https://www.postgresql.org/message-id/caectzexf3_ozou6mgfcoy5+pdz5n4xth0da4a5n_kacravw...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/847c62ee76cbc237b

Re: pgsql: Fix pattern matching logic for logs in TAP tests of pgbench

2021-06-24 Thread Michael Paquier
On Thu, Jun 24, 2021 at 10:26:18PM -0400, Andrew Dunstan wrote: > Since the file isn't read in using slurp_file, that $ won't match > because the lines will end \r\n instead of \n. I did not remember this one with Msys, thanks. I am not sure that there is any need for an eval block here actually

Re: Ubuntu 14.04 (trusty) Postgres 13 deb package

2021-06-24 Thread Bhavesh Mistry
Hi Thomas, I am glad you answered it with the archive repo. I have already sent it to the general. Thank you for your help! Thanks, Bhavesh On Thu, Jun 24, 2021 at 3:08 PM Thomas Munro wrote: > On Fri, Jun 25, 2021 at 10:06 AM Thomas Munro > wrote: > > pgsql-hackers > > (Oops, I meant to w

pgsql: Remove redundant variable pageSize in gistinitpage

2021-06-24 Thread Peter Eisentraut
Remove redundant variable pageSize in gistinitpage In gistinitpage, pageSize variable looks redundant, instead just pass BLCKSZ. This will be consistent with its peers BloomInitPage, brin_page_init and SpGistInitPage. Author: Bharath Rupireddy Discussion: https://www.postgresql.org/message-id/f

pgsql: doc: Change reloption data type spelling for consistency

2021-06-24 Thread Peter Eisentraut
doc: Change reloption data type spelling for consistency Use "floating point" rather than "float4", like everywhere else in this context. Author: shinya11.k...@nttdata.com Discussion: https://www.postgresql.org/message-id/flat/tyapr01mb28965989af84b57fc351b97bc4...@tyapr01mb2896.jpnprd01.prod.ou

pgsql: doc: Change reloption data type spelling for consistency

2021-06-24 Thread Peter Eisentraut
doc: Change reloption data type spelling for consistency Use "floating point" rather than "float4", like everywhere else in this context. Author: shinya11.k...@nttdata.com Discussion: https://www.postgresql.org/message-id/flat/tyapr01mb28965989af84b57fc351b97bc4...@tyapr01mb2896.jpnprd01.prod.ou