Re: pgsql: Refactor libpq state machine for negotiating encryption
Thanks for the report! On 11/04/2024 02:33, Thomas Munro wrote: On Thu, Apr 11, 2024 at 11:25 AM Tom Lane wrote: Thomas Munro writes: If -Dssl=none and -Dgssapi=disabled, compilation of fe-connect.c fails: call to undeclared function 'encryption_negotiation_failed'. I didn't look too hard, but maybe ENABLE_GSS and USE_GSS are confused? For me, configure --with-gssapi fails like that, but the other three combinations of --with-openssl and --with-gssapi compile OK. I don't find it terribly surprising that the buildfarm isn't covering that combination ... Oops, right, correction to my report: it is indeed -Dssl=none -Dgssapi=enabled that is broken, not the other combinations. Yes, I misspelled ENABLE_GSS as USE_GSS. After fixing that, the new tests are failing; the expected output for many of the cases is different when GSSAPI support is not compiled in. I think the test tables need to be rearranged some more to take that into account, or we will end up with a ridiculous amount of different expected outputs. I will take a closer look at that tomorrow. As a bandaid fix, we could temporarily disable the new tests with that combination of configure options, it's still better test coverage than not having the tests at all. But given that no buildfarm members are testing that combination I think it can wait a day. -- Heikki Linnakangas Neon (https://neon.tech)
pgsql: Doc: fix bogus to_date() examples.
Doc: fix bogus to_date() examples. November doesn't have 31 days. Remarkably, this thinko has escaped detection since commit 3f1998727. Noted by Y. Saburov. Discussion: https://postgr.es/m/171276122213.681.531905738590773...@wrigleys.postgresql.org Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/commitdiff/268e723b12fad75a8171b2f3fcfaaa7881751911 Modified Files -- doc/src/sgml/func.sgml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
pgsql: Doc: fix bogus to_date() examples.
Doc: fix bogus to_date() examples. November doesn't have 31 days. Remarkably, this thinko has escaped detection since commit 3f1998727. Noted by Y. Saburov. Discussion: https://postgr.es/m/171276122213.681.531905738590773...@wrigleys.postgresql.org Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/6d4f062714953ed0ec865ff96d5af122b8c3e77f Modified Files -- doc/src/sgml/func.sgml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
pgsql: Doc: fix bogus to_date() examples.
Doc: fix bogus to_date() examples. November doesn't have 31 days. Remarkably, this thinko has escaped detection since commit 3f1998727. Noted by Y. Saburov. Discussion: https://postgr.es/m/171276122213.681.531905738590773...@wrigleys.postgresql.org Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/commitdiff/7924036cbb2f7160c84f38747abbfa39929a9202 Modified Files -- doc/src/sgml/func.sgml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
pgsql: Doc: fix bogus to_date() examples.
Doc: fix bogus to_date() examples. November doesn't have 31 days. Remarkably, this thinko has escaped detection since commit 3f1998727. Noted by Y. Saburov. Discussion: https://postgr.es/m/171276122213.681.531905738590773...@wrigleys.postgresql.org Branch -- REL_14_STABLE Details --- https://git.postgresql.org/pg/commitdiff/da11a14e0c79af98869ce8929fa9bdfe7cc690cb Modified Files -- doc/src/sgml/func.sgml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
pgsql: Doc: fix bogus to_date() examples.
Doc: fix bogus to_date() examples. November doesn't have 31 days. Remarkably, this thinko has escaped detection since commit 3f1998727. Noted by Y. Saburov. Discussion: https://postgr.es/m/171276122213.681.531905738590773...@wrigleys.postgresql.org Branch -- REL_16_STABLE Details --- https://git.postgresql.org/pg/commitdiff/e177da5c87a10abac97c028bfb427bafb7353aa2 Modified Files -- doc/src/sgml/func.sgml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
pgsql: Doc: fix bogus to_date() examples.
Doc: fix bogus to_date() examples. November doesn't have 31 days. Remarkably, this thinko has escaped detection since commit 3f1998727. Noted by Y. Saburov. Discussion: https://postgr.es/m/171276122213.681.531905738590773...@wrigleys.postgresql.org Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/164c945c38648a64e9f4778df0a6900625085d3c Modified Files -- doc/src/sgml/func.sgml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
pgsql: Revert: Implement pg_wal_replay_wait() stored procedure
Revert: Implement pg_wal_replay_wait() stored procedure This commit reverts 06c418e163, e37662f221, bf1e650806, 25f42429e2, ee79928441, and 74eaf66f98 per review by Heikki Linnakangas. Discussion: https://postgr.es/m/b155606b-e744-4218-bda5-29379779da1a%40iki.fi Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/772faafca1b288c4dd66b7150a7831c27b768003 Modified Files -- doc/src/sgml/func.sgml | 113 src/backend/access/transam/xact.c | 6 - src/backend/access/transam/xlog.c | 7 - src/backend/access/transam/xlogrecovery.c | 11 - src/backend/catalog/system_functions.sql| 3 - src/backend/commands/Makefile | 3 +- src/backend/commands/meson.build| 1 - src/backend/commands/waitlsn.c | 337 src/backend/lib/pairingheap.c | 18 +- src/backend/storage/ipc/ipci.c | 3 - src/backend/storage/lmgr/proc.c | 6 - src/backend/utils/activity/wait_event_names.txt | 2 - src/include/catalog/catversion.h| 2 +- src/include/catalog/pg_proc.dat | 5 - src/include/commands/waitlsn.h | 77 -- src/include/lib/pairingheap.h | 3 - src/include/storage/lwlocklist.h| 1 - src/test/recovery/meson.build | 1 - src/test/recovery/t/043_wal_replay_wait.pl | 97 --- src/tools/pgindent/typedefs.list| 2 - 20 files changed, 4 insertions(+), 694 deletions(-)
pgsql: Revert: Let table AM insertion methods control index insertion
Revert: Let table AM insertion methods control index insertion This commit reverts b1484a3f19 per review by Andres Freund. Discussion: https://postgr.es/m/20240410165236.rwyrny7ihi4ddxw4%40awork3.anarazel.de Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/da841aa4dc279bb0053de56121c927ec943edff3 Modified Files -- src/backend/access/heap/heapam.c | 4 +--- src/backend/access/heap/heapam_handler.c | 4 +--- src/backend/access/table/tableam.c | 6 ++ src/backend/catalog/indexing.c | 4 +--- src/backend/commands/copyfrom.c | 13 - src/backend/commands/createas.c | 4 +--- src/backend/commands/matview.c | 4 +--- src/backend/commands/tablecmds.c | 22 +- src/backend/executor/execReplication.c | 6 ++ src/backend/executor/nodeModifyTable.c | 6 ++ src/include/access/heapam.h | 2 +- src/include/access/tableam.h | 25 +++-- 12 files changed, 28 insertions(+), 72 deletions(-)
pgsql: Revert: Allow table AM to store complex data structures in rd_am
Revert: Allow table AM to store complex data structures in rd_amcache This commit reverts 02eb07ea89 per review by Andres Freund. Discussion: https://postgr.es/m/20240410165236.rwyrny7ihi4ddxw4%40awork3.anarazel.de Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/922c4c461d213a422ee7eb6c38e399607539210a Modified Files -- src/backend/access/heap/heapam_handler.c | 1 - src/backend/utils/cache/relcache.c | 11 --- src/include/access/tableam.h | 34 src/include/utils/rel.h | 10 -- 4 files changed, 12 insertions(+), 44 deletions(-)
pgsql: Revert: Allow table AM tuple_insert() method to return the diffe
Revert: Allow table AM tuple_insert() method to return the different slot This commit reverts c35a3fb5e0 per review by Andres Freund. Discussion: https://postgr.es/m/20240410165236.rwyrny7ihi4ddxw4%40awork3.anarazel.de Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/8dd0bb84da7d56a9e41241b26bfbf6b79644d574 Modified Files -- src/backend/access/heap/heapam_handler.c | 4 +--- src/backend/commands/tablecmds.c | 8 src/backend/executor/nodeModifyTable.c | 6 +++--- src/include/access/tableam.h | 21 + 4 files changed, 17 insertions(+), 22 deletions(-)
pgsql: Revert: Allow locking updated tuples in tuple_update() and tuple
Revert: Allow locking updated tuples in tuple_update() and tuple_delete() This commit reverts 87985cc925 and 818861eb57 per review by Andres Freund. Discussion: https://postgr.es/m/20240410165236.rwyrny7ihi4ddxw4%40awork3.anarazel.de Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/193e6d18e553a104d315ff81892d509d89a30fd8 Modified Files -- src/backend/access/heap/heapam.c | 205 +- src/backend/access/heap/heapam_handler.c | 93 ++-- src/backend/access/table/tableam.c | 26 +-- src/backend/commands/trigger.c | 55 +++-- src/backend/executor/execReplication.c | 19 +- src/backend/executor/nodeModifyTable.c | 353 +-- src/include/access/heapam.h | 19 +- src/include/access/tableam.h | 73 ++- src/include/commands/trigger.h | 4 +- 9 files changed, 346 insertions(+), 501 deletions(-)
pgsql: Revert: Custom reloptions for table AM
Revert: Custom reloptions for table AM This commit reverts 9bd99f4c26 and 422041542f per review by Andres Freund. Discussion: https://postgr.es/m/20240410165236.rwyrny7ihi4ddxw4%40awork3.anarazel.de Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/bc1e2092ebb857802a9713d0d3588079e2f0216a Modified Files -- src/backend/access/common/reloptions.c | 149 + src/backend/access/heap/heapam.c | 4 +- src/backend/access/heap/heapam_handler.c | 13 -- src/backend/access/heap/heaptoast.c| 9 +- src/backend/access/heap/hio.c | 4 +- src/backend/access/heap/pruneheap.c| 4 +- src/backend/access/heap/rewriteheap.c | 4 +- src/backend/access/table/tableam.c | 2 +- src/backend/access/table/tableamapi.c | 25 src/backend/commands/createas.c| 13 +- src/backend/commands/tablecmds.c | 63 - src/backend/commands/vacuum.c | 8 +- src/backend/postmaster/autovacuum.c| 13 +- src/backend/tcop/utility.c | 28 +--- src/backend/utils/cache/relcache.c | 54 +--- src/include/access/reloptions.h| 11 +- src/include/access/tableam.h | 50 --- src/include/utils/rel.h| 148 ++-- src/test/modules/Makefile | 1 - src/test/modules/meson.build | 1 - src/test/modules/test_tam_options/.gitignore | 4 - src/test/modules/test_tam_options/Makefile | 23 .../test_tam_options/expected/test_tam_options.out | 36 - src/test/modules/test_tam_options/meson.build | 33 - .../test_tam_options/sql/test_tam_options.sql | 25 .../test_tam_options/test_tam_options--1.0.sql | 12 -- .../modules/test_tam_options/test_tam_options.c| 66 - .../test_tam_options/test_tam_options.control | 4 - src/tools/pgindent/typedefs.list | 4 +- 29 files changed, 161 insertions(+), 650 deletions(-)
pgsql: meson: Remove obsolete function test
meson: Remove obsolete function test The test for pstat was removed from configure by 9db300ce6e3 but not from meson.build. Do that now. Branch -- REL_16_STABLE Details --- https://git.postgresql.org/pg/commitdiff/3ceb2f96d2d1e2a2e9b884c86c705419e80f39ec Modified Files -- meson.build | 1 - 1 file changed, 1 deletion(-)
pgsql: meson: Remove obsolete function test
meson: Remove obsolete function test The test for pstat was removed from configure by 9db300ce6e3 but not from meson.build. Do that now. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/87840b9741864dfdb9f63b0056e2783cdb49b8a5 Modified Files -- meson.build | 1 - 1 file changed, 1 deletion(-)
pgsql: postgres_fdw: Improve comment about handling of asynchronous req
postgres_fdw: Improve comment about handling of asynchronous requests. We updated this comment in back branches (see commit f6f61a4bd et al); let's do so in HEAD as well for consistency. Discussion: https://postgr.es/m/CAPmGK142V1kqDfjo2H%2Bb54JTn2woVBrisFq%2B%3D9jwXwxr0VvbgA%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/56c6703bd0beb1ade7816d6bdc4372c4933ec461 Modified Files -- contrib/postgres_fdw/postgres_fdw.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-)
pgsql: Fix WaitEventSet resource leak in WaitLatchOrSocket().
Fix WaitEventSet resource leak in WaitLatchOrSocket(). This function would have the same issue we solved in commit 501cfd07d: If an error is thrown after calling CreateWaitEventSet(), the file descriptor (on epoll- or kqueue-based systems) or handles (on Windows) that the WaitEventSet contains are leaked. Like that commit, use PG_TRY-PG_FINALLY (PG_TRY-PG_CATCH in v12) to make sure the WaitEventSet is freed properly. Back-patch to all supported versions, but as we do not have this issue in HEAD (cf. commit 50c67c201), no need to apply this patch to it. Discussion: https://postgr.es/m/CAPmGK16MqdDoD8oatp8SQWaEa4vS3nfQqDN_Sj9YRuu5J3Lj9g%40mail.gmail.com Branch -- REL_14_STABLE Details --- https://git.postgresql.org/pg/commitdiff/b714bc40cf066dde745fcb78fde160788730a7be Modified Files -- src/backend/storage/ipc/latch.c | 70 ++--- 1 file changed, 38 insertions(+), 32 deletions(-)
pgsql: Fix WaitEventSet resource leak in WaitLatchOrSocket().
Fix WaitEventSet resource leak in WaitLatchOrSocket(). This function would have the same issue we solved in commit 501cfd07d: If an error is thrown after calling CreateWaitEventSet(), the file descriptor (on epoll- or kqueue-based systems) or handles (on Windows) that the WaitEventSet contains are leaked. Like that commit, use PG_TRY-PG_FINALLY (PG_TRY-PG_CATCH in v12) to make sure the WaitEventSet is freed properly. Back-patch to all supported versions, but as we do not have this issue in HEAD (cf. commit 50c67c201), no need to apply this patch to it. Discussion: https://postgr.es/m/CAPmGK16MqdDoD8oatp8SQWaEa4vS3nfQqDN_Sj9YRuu5J3Lj9g%40mail.gmail.com Branch -- REL_16_STABLE Details --- https://git.postgresql.org/pg/commitdiff/e79ceafe93a85820188e835adb392d38331ceed2 Modified Files -- src/backend/storage/ipc/latch.c | 70 ++--- 1 file changed, 38 insertions(+), 32 deletions(-)
pgsql: Fix WaitEventSet resource leak in WaitLatchOrSocket().
Fix WaitEventSet resource leak in WaitLatchOrSocket(). This function would have the same issue we solved in commit 501cfd07d: If an error is thrown after calling CreateWaitEventSet(), the file descriptor (on epoll- or kqueue-based systems) or handles (on Windows) that the WaitEventSet contains are leaked. Like that commit, use PG_TRY-PG_FINALLY (PG_TRY-PG_CATCH in v12) to make sure the WaitEventSet is freed properly. Back-patch to all supported versions, but as we do not have this issue in HEAD (cf. commit 50c67c201), no need to apply this patch to it. Discussion: https://postgr.es/m/CAPmGK16MqdDoD8oatp8SQWaEa4vS3nfQqDN_Sj9YRuu5J3Lj9g%40mail.gmail.com Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/commitdiff/b82dca2a5a929c2b65174a073194a9cfb080052f Modified Files -- src/backend/storage/ipc/latch.c | 70 ++--- 1 file changed, 38 insertions(+), 32 deletions(-)
pgsql: Fix WaitEventSet resource leak in WaitLatchOrSocket().
Fix WaitEventSet resource leak in WaitLatchOrSocket(). This function would have the same issue we solved in commit 501cfd07d: If an error is thrown after calling CreateWaitEventSet(), the file descriptor (on epoll- or kqueue-based systems) or handles (on Windows) that the WaitEventSet contains are leaked. Like that commit, use PG_TRY-PG_FINALLY (PG_TRY-PG_CATCH in v12) to make sure the WaitEventSet is freed properly. Back-patch to all supported versions, but as we do not have this issue in HEAD (cf. commit 50c67c201), no need to apply this patch to it. Discussion: https://postgr.es/m/CAPmGK16MqdDoD8oatp8SQWaEa4vS3nfQqDN_Sj9YRuu5J3Lj9g%40mail.gmail.com Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/commitdiff/0341d4b10e786dcbc4c63da9d21af842ab31e118 Modified Files -- src/backend/storage/ipc/latch.c | 69 +++-- 1 file changed, 39 insertions(+), 30 deletions(-)
pgsql: Fix WaitEventSet resource leak in WaitLatchOrSocket().
Fix WaitEventSet resource leak in WaitLatchOrSocket(). This function would have the same issue we solved in commit 501cfd07d: If an error is thrown after calling CreateWaitEventSet(), the file descriptor (on epoll- or kqueue-based systems) or handles (on Windows) that the WaitEventSet contains are leaked. Like that commit, use PG_TRY-PG_FINALLY (PG_TRY-PG_CATCH in v12) to make sure the WaitEventSet is freed properly. Back-patch to all supported versions, but as we do not have this issue in HEAD (cf. commit 50c67c201), no need to apply this patch to it. Discussion: https://postgr.es/m/CAPmGK16MqdDoD8oatp8SQWaEa4vS3nfQqDN_Sj9YRuu5J3Lj9g%40mail.gmail.com Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/01b01a77fe786740ec5e657e5f2ed0a94ab0ac17 Modified Files -- src/backend/storage/ipc/latch.c | 70 ++--- 1 file changed, 38 insertions(+), 32 deletions(-)
pgsql: Use correct datatype for xmin variables in slot.c
Use correct datatype for xmin variables in slot.c Two variables storing a slot's effective_xmin and effective_catalog_xmin were saved as XLogRecPtr, which is incorrect as these should be TransactionIds. Oversight in 818fefd8fd44. Author: Bharath Rupireddy Discussion: https://postgr.es/m/calj2acvpsb74mrdtfezz-lv3oi6f3sn71qa0ouhvndzi5dw...@mail.gmail.com Backpatch-through: 16 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/8f136af3c41c3b7e6474d6dd05238f11059f26f1 Modified Files -- src/backend/replication/slot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
pgsql: Use correct datatype for xmin variables in slot.c
Use correct datatype for xmin variables in slot.c Two variables storing a slot's effective_xmin and effective_catalog_xmin were saved as XLogRecPtr, which is incorrect as these should be TransactionIds. Oversight in 818fefd8fd44. Author: Bharath Rupireddy Discussion: https://postgr.es/m/calj2acvpsb74mrdtfezz-lv3oi6f3sn71qa0ouhvndzi5dw...@mail.gmail.com Backpatch-through: 16 Branch -- REL_16_STABLE Details --- https://git.postgresql.org/pg/commitdiff/574c7c754666a2b5634efd700d3602629d261362 Modified Files -- src/backend/replication/slot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
pgsql: Revert indexed and enlargable binary heap implementation.
Revert indexed and enlargable binary heap implementation. This reverts commit b840508644 and bcb14f4abc. These commits were made for commit 5bec1d6bc5 (Improve eviction algorithm in ReorderBuffer using max-heap for many subtransactions). However, per discussion, commit efb8acc0d0 replaced binary heap + index with pairing heap, and made these commits unnecessary. Reported-by: Jeff Davis Discussion: https://postgr.es/m/12747c15811d94efcc5cda72d6b35c80d7bf3443.camel%40j-davis.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/810f64a01567610af7b92b0de930f16f3e20064e Modified Files -- src/backend/executor/nodeGatherMerge.c | 1 - src/backend/executor/nodeMergeAppend.c | 2 +- src/backend/postmaster/pgarch.c | 3 +- src/backend/replication/logical/reorderbuffer.c | 1 - src/backend/storage/buffer/bufmgr.c | 1 - src/bin/pg_dump/pg_backup_archiver.c| 1 - src/bin/pg_dump/pg_dump_sort.c | 2 +- src/common/binaryheap.c | 245 src/include/lib/binaryheap.h| 40 +--- src/tools/pgindent/typedefs.list| 1 - 10 files changed, 38 insertions(+), 259 deletions(-)
pgsql: Replace binaryheap + index with pairingheap in reorderbuffer.c
Replace binaryheap + index with pairingheap in reorderbuffer.c A pairing heap can perform the same operations as the binary heap + index, with as good or better algorithmic complexity, and that's an existing data structure so that we don't need to invent anything new compared to v16. This commit makes the new binaryheap functionality that was added in commits b840508644 and bcb14f4abc unnecessary, but they will be reverted separately. Remove the optimization to only build and maintain the heap when the amount of memory used is close to the limit, becuase the bookkeeping overhead with the pairing heap seems to be small enough that it doesn't matter in practice. Reported-by: Jeff Davis Author: Heikki Linnakangas Reviewed-by: Michael Paquier, Hayato Kuroda, Masahiko Sawada Discussion: https://postgr.es/m/12747c15811d94efcc5cda72d6b35c80d7bf3443.camel%40j-davis.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/efb8acc0d05894e0c6c20dfc00513b53098780f0 Modified Files -- src/backend/replication/logical/reorderbuffer.c | 191 +++- src/include/replication/reorderbuffer.h | 9 +- 2 files changed, 30 insertions(+), 170 deletions(-)
Re: pgsql: Fix race leading to incorrect conflict cause in InvalidatePossib
On Thu, Apr 11, 2024 at 12:38:06PM +0530, Bharath Rupireddy wrote: > I found a typo with the code added by this commit - we've used > XLogRecPtr/InvalidXLogRecPtr for xmins in place of > TransactionId/InvalidTransactionId. Attached a patch to fix this. Thanks for the report. Will fix. -- Michael signature.asc Description: PGP signature
Re: pgsql: Fix race leading to incorrect conflict cause in InvalidatePossib
On Tue, Feb 20, 2024 at 10:14 AM Michael Paquier wrote: > > Fix race leading to incorrect conflict cause in > InvalidatePossiblyObsoleteSlot() I found a typo with the code added by this commit - we've used XLogRecPtr/InvalidXLogRecPtr for xmins in place of TransactionId/InvalidTransactionId. Attached a patch to fix this. -- Bharath Rupireddy PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com v1-0001-Use-correct-datatype-for-xmin-variables-added-by-.patch Description: Binary data