Add memory_limit_hits to pg_stat_replication_slots

2025-08-27 Thread Bertrand Drouvot
Hi hackers, I think that it's currently not always possible to determine how many times logical_decoding_work_mem has been reached. For example, say a transaction is made of 40 subtransactions, and I get: slot_name | spill_txns | spill_count | total_txns --++-

Re: SQL:2023 JSON simplified accessor support

2025-08-27 Thread Chao Li
> On Aug 26, 2025, at 11:52, Alexandra Wang > wrote: > > Best, > Alex > I just started with 0001, I just got a comment: diff --git a/src/include/parser/parse_node.h b/src/include/parser/parse_node.h index f7d07c84542..58a4b9df157 100644 --- a/src/include/parser/parse_node.h +++ b/src/inclu

Re: Inconsistent update in the MERGE command

2025-08-27 Thread Dean Rasheed
On Sun, 24 Aug 2025 at 18:34, Yugo Nagata wrote: > > I confirmed this issue by executing the following query concurrently > in three transactions. (With only two transactions, the issue does not occur.) Yes, I think 3 transactions are required to reproduce this (2 separate concurrent updates). >

Re: Per backend relation statistics tracking

2025-08-27 Thread Bertrand Drouvot
Hi, On Tue, Aug 26, 2025 at 04:55:09PM -0500, Sami Imseih wrote: > I worry that a single view will grow very wide, and we will have to eventually > split it. So we may as well start thinking about having multiple views > in advance. I gave it more thoughts and I now think that multiple views is b

Re: Report bytes and transactions actually sent downtream

2025-08-27 Thread Bertrand Drouvot
Hi, On Thu, Jul 24, 2025 at 12:24:26PM +0530, Ashutosh Bapat wrote: > Here's the next patch which considers all the discussion so far. It > adds four fields to pg_stat_replication_slots. > - plugin - name of the output plugin Is this one needed? (we could get it with a join on pg_replication_

Re: Buffer locking is special (hints, checksums, AIO writes)

2025-08-27 Thread Robert Haas
On Tue, Aug 26, 2025 at 8:14 PM Noah Misch wrote: > > > AFAIK "share exclusive" or "SX" is standard terminology. > > Can you say more about that? Looks like I was misremembering. I was thinking of Gray & Reuter, Transaction Processing: Concepts and Techniques, 1993. However, opening it up, I find

Re: Issue with logical replication slot during switchover

2025-08-27 Thread Fabrice Chapuis
For the first step (a), the pg_create_logical_replication_slot interface is extended. The slot on the new attached standby will be dropped and recreated if the flag allow_overwrite is set to true. I tested the modified source, could you please give me a feedback on code changes. Regards, Fabrice

Re: Potential problem in commit f777d773878 and 4f7f7b03758

2025-08-27 Thread Peter Eisentraut
On 27.08.25 14:39, Matheus Alcantara wrote: On Tue Aug 26, 2025 at 3:26 AM -03, Dilip Kumar wrote: On Tue, Aug 26, 2025 at 11:31 AM Dilip Kumar wrote: On Sun, Aug 24, 2025 at 5:59 PM Srinath Reddy Sadipiralla wrote: Hi, Thanks Dilip and Matheus for working on this , i reviewed the latest p

Re: Report reorder buffer size

2025-08-27 Thread Bertrand Drouvot
Hi, On Tue, Aug 26, 2025 at 09:48:04AM +, Bertrand Drouvot wrote: > Hi, > > On Tue, Aug 26, 2025 at 02:56:14PM +0530, Ashutosh Bapat wrote: > > On Mon, Aug 25, 2025 at 6:28 PM Bertrand Drouvot > > wrote: > > > > I didn't know this is how it works. Thanks for correcting me. In that > > > > ca

Re: Remove traces of long in dynahash.c

2025-08-27 Thread Peter Eisentraut
On 22.08.25 07:09, Michael Paquier wrote: An extra thing is a suggested change for pg_nextpower2_32(), to use a uint64 instead of a uint32 as argument, which is caused by next_pow2_int64() and next_pow2_int(), that both used int64 previously. That seems highly confusing. What is the meaning of

Re: Inconsistent update in the MERGE command

2025-08-27 Thread Dmitry
On 24.08.2025 20:34, Yugo Nagata wrote: I've attached a patch to fix this. I ran tests with this patch [1] and it seems to have fixed the issue. Thank you very much for your work. [1] https://www.postgresql.org/message-id/attachment/180494/0001-Fix-misuse-of-TM_FailureData.ctid-in-ExecMergeMa

Re: Adding REPACK [concurrently]

2025-08-27 Thread Mihail Nikalayeu
Antonin Houska : > I insist that this is a misuse of TransactionIdIsInProgress(). When dealing > with logical decoding, only WAL should tell whether particular transaction is > still running. AFAICS this is how reorderbuffer.c works. Hm... Maybe, but at the same time we already have SnapshotDirty

Re: Non-reproducible AIO failure

2025-08-27 Thread Thomas Munro
On Thu, Aug 28, 2025 at 11:08 AM Andres Freund wrote: > On 2025-08-26 16:59:54 +0300, Konstantin Knizhnik wrote: > > Still it is not quite clear to me how bitfields can cause this issue. > > Same. Here's what I speculated after reading the generated asm[1]: "Could it be that the store buffer was

Re: [BUG] Remove self joins causes 'variable not found in subplan target lists' error

2025-08-27 Thread Tom Lane
I wrote: > This leaves us with some pretty unappetizing choices about what > to do in v18: > 1. Try to emulate the proposed HEAD fix. Actually, a preliminary look suggests that we can approximate that quite well, because v18's create_unique_path() is already responsible for preparing the list of c

Re: Support getrandom() for pg_strong_random() source

2025-08-27 Thread Masahiko Sawada
On Tue, Aug 26, 2025 at 12:42 AM Daniel Gustafsson wrote: > > > On 26 Aug 2025, at 00:38, Jacob Champion > > wrote: > > > > On Mon, Aug 25, 2025 at 3:22 PM Masahiko Sawada > > wrote: > >> > >> For instance, we could > >> introduce a GUC parameter that lets users specify their preferred > >> ra

Re: Identifying function-lookup failures due to argument name mismatches

2025-08-27 Thread Chao Li
> On Aug 27, 2025, at 23:42, Peter Eisentraut wrote: > > On 25.08.25 04:43, Chao Li wrote: >> Can we avoid the duplication in a way like: >> ``` >> static int >> func_lookup_failure_details(int fgc_flags, List *argnames, bool proc_call) >> { >> const char *func_kind = proc_call ? "procedur

Re: Non-reproducible AIO failure

2025-08-27 Thread Andres Freund
On 2025-08-27 19:08:20 -0400, Andres Freund wrote: > I'll push the patch to remove the bitfields after adjusting the commit message > somewhat. And done.

Re: Inconsistent update in the MERGE command

2025-08-27 Thread Chao Li
> On Aug 25, 2025, at 01:34, Yugo Nagata wrote: > > Currently, TM_FailureData.ctid is used as a reference to the > latest version of oldtuple, but this is not always correct. > Instead, the tupleid passed to table_tuple_lock should be used. Based on my understanding: At line 3386:

Re: Fix ALTER TABLE DROP EXPRESSION with inheritance hierarchy

2025-08-27 Thread jian he
On Mon, Aug 25, 2025 at 9:04 PM Kirill Reshke wrote: > > Hi! > > On Sun, 24 Aug 2025 at 14:05, jian he wrote: > > > > hi. > > > > --this ALTER COLUMN DROP EXPRESSION work as expected > > DROP TABLE IF EXISTS parent cascade; > > CREATE TABLE parent (a int, d INT GENERATED ALWAYS AS (11) STORED);

Re: Report reorder buffer size

2025-08-27 Thread Masahiko Sawada
On Tue, Aug 26, 2025 at 2:45 AM Ashutosh Bapat wrote: > > Hi Masahiko, > Thanks for your inputs. > > On Tue, Aug 26, 2025 at 2:17 AM Masahiko Sawada wrote: > > > On Wed, Aug 13, 2025 at 5:40 AM Ashutosh Bapat > > wrote: > > > > Thank you for starting the thread about this topic. This is one of t

[patch] ALTER COLUMN SET EXPRESSION [GENERATED|STORED]

2025-08-27 Thread jian he
hi. I realized that we can also modify attgenerated when updating the generated expression using ALTER COLUMN SET EXPRESSION. so POC attached. I have also considered using ALTER TABLE ALTER COLUMN STORED/VIRTUAL to change attgenerated, but since we can update both the generated expression and attg

Re: Potential problem in commit f777d773878 and 4f7f7b03758

2025-08-27 Thread Dilip Kumar
On Wed, Aug 27, 2025 at 7:47 PM Peter Eisentraut wrote: > > >> Please find the revised patch with improved comments and commit messages. > >> > > Thanks for the improvements! LGTM. > > committed, thanks > Thanks Peter. -- Regards, Dilip Kumar Google

Re: Report reorder buffer size

2025-08-27 Thread Ashutosh Bapat
On Thu, Aug 28, 2025 at 5:56 AM Masahiko Sawada wrote: > > On Tue, Aug 26, 2025 at 2:45 AM Ashutosh Bapat > wrote: > > > > Hi Masahiko, > > Thanks for your inputs. > > > > On Tue, Aug 26, 2025 at 2:17 AM Masahiko Sawada > > wrote: > > > > > On Wed, Aug 13, 2025 at 5:40 AM Ashutosh Bapat > > >

Re: Avoid retaining conflict-related data when no tables are subscribed

2025-08-27 Thread Dilip Kumar
On Thu, Aug 28, 2025 at 7:54 AM Zhijie Hou (Fujitsu) wrote: > > Hi, > > My colleague Nisha reported an issue to me off-list: dead tuples can't > be removed when retain_dead_tuples is enabled for a subscription with no > tables. > > This appears to stem from the inability to advance the non-remova

Re: Fix ALTER TABLE DROP EXPRESSION with inheritance hierarchy

2025-08-27 Thread Kirill Reshke
On Thu, 28 Aug 2025 at 08:35, jian he wrote: > > That means, we don't need to change the ATPrepDropExpression function > argument for now? Sure. V3 with this attached, and I think we can move cf entry to RFC -- Best regards, Kirill Reshke v3-0001-Fix-ALTER-TABLE-DROP-EXPRESSION-with-inheritan

How can end users know the cause of LR slot sync delays?

2025-08-27 Thread Ashutosh Sharma
Hi, We have seen cases where slot synchronization gets delayed, for example when the slot is behind the failover standby or vice versa, and the slot sync worker has to wait for one to catch up with the other. During this waiting period, users querying pg_replication_slots can only see whether the

Re: Avoid retaining conflict-related data when no tables are subscribed

2025-08-27 Thread Steven Niu
Just a typo: +* it seem feasible to skip all phases and directly assign Should be "it seems". Regards, Steven 在 2025/8/28 10:23, Zhijie Hou (Fujitsu) 写道: Hi, My colleague Nisha reported an issue to me off-list: dead tuples can't be removed when retain_dead_tuples is enabled for a s

doc patch: missing tags in protocol.sgml

2025-08-27 Thread Hayato Kuroda (Fujitsu)
Dear hackers, I found that in protocol.sgml, the parameter "streaming" is mentioned twice [1] but both are not tagged. IIUC, "streaming" can be and "parallel" can be . Also, the first "streaming" can have a link to the pgoutput's manual. Attached patch fixes like that. Thanks Peter Smith and

Re: [BUG] Remove self joins causes 'variable not found in subplan target lists' error

2025-08-27 Thread Richard Guo
On Thu, Aug 28, 2025 at 6:42 AM Tom Lane wrote: > This leaves us with some pretty unappetizing choices about what > to do in v18: > > 1. Try to emulate the proposed HEAD fix. > > 2. Try to fix up the SJE patch so that it calculates relid changes > honestly, or at least no less honestly than what h

Re: Avoid retaining conflict-related data when no tables are subscribed

2025-08-27 Thread shveta malik
On Thu, Aug 28, 2025 at 7:54 AM Zhijie Hou (Fujitsu) wrote: > > Hi, > > My colleague Nisha reported an issue to me off-list: dead tuples can't > be removed when retain_dead_tuples is enabled for a subscription with no > tables. > > This appears to stem from the inability to advance the non-remova

Re: Qual push down to table AM

2025-08-27 Thread Andres Freund
On 2025-08-27 22:27:37 +0200, Julien Tachoires wrote: > Please find attached a patch set proposal intended to implement WHERE > clauses (qual) push down to the underlying table AM during > table/sequential scan execution. > > The primary goal of this project is to convert quals to ScanKeys and > p

Re: Qual push down to table AM

2025-08-27 Thread Kirill Reshke
On Thu, 28 Aug 2025 at 01:27, Julien Tachoires wrote: > > Hi, > > Please find attached a patch set proposal intended to implement WHERE > clauses (qual) push down to the underlying table AM during > table/sequential scan execution. > > The primary goal of this project is to convert quals to ScanKe

Re: [BUG] Remove self joins causes 'variable not found in subplan target lists' error

2025-08-27 Thread Tom Lane
Richard Guo writes: > On Wed, Aug 27, 2025 at 2:26 AM Tom Lane wrote: >> I wonder if the right answer in v18 is to back out a3179ab69. >> Not fixing that performance regression for another year would >> be mildly annoying; but AFAIR we've still had only the one >> complaint, so it seems like it's

Re: Buffer locking is special (hints, checksums, AIO writes)

2025-08-27 Thread Noah Misch
On Wed, Aug 27, 2025 at 03:29:02PM -0400, Andres Freund wrote: > On 2025-08-27 12:14:41 -0700, Noah Misch wrote: > > On Wed, Aug 27, 2025 at 12:18:27PM -0400, Andres Freund wrote: > > > > On Tue, Aug 26, 2025 at 05:00:13PM -0400, Andres Freund wrote: > > > > > On 2025-08-26 16:21:36 -0400, Robert H

Re: Non-reproducible AIO failure

2025-08-27 Thread Andres Freund
Hi, On 2025-08-26 16:59:54 +0300, Konstantin Knizhnik wrote: > On 26/08/2025 3:37 AM, Andres Freund wrote: > > Hi, > > > > I'm a bit confused by this focus on bitfields - both Alexander and > > Konstantin > > stated they could reproduce the issue without the bitfields. > > > Sorry if I am not

Avoid retaining conflict-related data when no tables are subscribed

2025-08-27 Thread Zhijie Hou (Fujitsu)
Hi, My colleague Nisha reported an issue to me off-list: dead tuples can't be removed when retain_dead_tuples is enabled for a subscription with no tables. This appears to stem from the inability to advance the non-removable transaction ID when AllTablesyncsReady() returns false. Since this funct

Re: Mark ItemPointer parameters as const in tuple/table lock functions

2025-08-27 Thread Chao Li
On Aug 27, 2025, at 17:24, Peter Eisentraut wrote:This style of having Foo be a type alias for pointer-to-FooData is an ancient Postgres coding convention that does not map well to modern C that has an emphasis on judicious use of qualifiers and attributes, and so if this abstraction gets in the w

Re: Mark ItemPointer parameters as const in tuple/table lock functions

2025-08-27 Thread Chao Li
Mail Archive always misses attachments sent by Apple Mail. Resending from the Gmail web client. Chao Li (Evan) - Highgo Software Co., Ltd. https://www.highgo.com/ Chao Li 于2025年8月28日周四 10:28写道: > > > On Aug 27, 2025, at 17:24, Peter Eisentraut wrote: > > This style of havi

RE: POC: enable logical decoding when wal_level = 'replica' without a server restart

2025-08-27 Thread Hayato Kuroda (Fujitsu)
Dear Sawada-san, > > Assuming that logical_decoding written in the WAL is false here, and a > > logical > > replication slot is created just after that. In my experiments below > > happened: > > > > Let me clarify each step: > > > 1. startup process updated logical_decoding_enabled to false, a

Re: Proper object locking for GRANT/REVOKE

2025-08-27 Thread Peter Eisentraut
On 26.08.25 18:21, Heikki Linnakangas wrote: +1 for the comment patch (0001-Improve-objectNamesToOids-comment.patch). +1 for also doing something like (0002-WIP-Attempt-to-put-back-intra- grant-inplace.spec-cov.patch), to keep the test coverage for the "cache lookup failed" error. Maybe add a

Re: Identifying function-lookup failures due to argument name mismatches

2025-08-27 Thread Peter Eisentraut
On 24.08.25 20:47, Tom Lane wrote: Here is a v4 with some additional bike-shedding on the error texts. In particular, I decided that it was worth expending an additional flag bit so that we could reliably distinguish "There is no function of that name" from "A function of that name exists, but it

Re: Identifying function-lookup failures due to argument name mismatches

2025-08-27 Thread Peter Eisentraut
On 25.08.25 04:43, Chao Li wrote: Can we avoid the duplication in a way like: ``` static int func_lookup_failure_details(int fgc_flags, List *argnames, bool proc_call) { const char *func_kind = proc_call ? "procedure" : "function"; /* if (proc_call) retur

Re: Implement waiting for wal lsn replay: reloaded

2025-08-27 Thread Xuneng Zhou
Hi all, I did a rebase for the patch to v8 and incorporated a few changes: 1) Updated documentation, added new tests, and applied minor code adjustments based on prior review comments. 2) Tweaked the initialization of waitReplayLSNState so that non-backend processes can call wait for replay. Sta

Re: END is not a reserved word

2025-08-27 Thread Vicky Vergara
Thanks, Just found the note on https://www.postgresql.org/docs/release/14.0/ Reduce the number of keywords that can't be used as column labels without AS (Mark Dilger) § * There are now 90% fewer restricted keywords. Next time I will read the releases changes be

Improve read_local_xlog_page_guts by replacing polling with latch-based waiting

2025-08-27 Thread Xuneng Zhou
Hi hackers, During a performance run [1], I observed heavy polling in read_local_xlog_page_guts(). Heikki’s comment from a few months ago suggests replacing the current check–sleep–repeat loop with the condition-variable (CV) infrastructure used by the walsender: 1) Problem and Background /* * L

Re: Improve read_local_xlog_page_guts by replacing polling with latch-based waiting

2025-08-27 Thread Xuneng Zhou
Hi, Attached the wrong patch v1-0001-Improve-read_local_xlog_page_guts-by-replacing-po.patch. The correct one is attached again. On Wed, Aug 27, 2025 at 11:23 PM Xuneng Zhou wrote: > > Hi hackers, > > During a performance run [1], I observed heavy polling in > read_local_xlog_page_guts(). Heikki

Re: List TAP test files in makefiles

2025-08-27 Thread Álvaro Herrera
On 2025-Aug-25, Andres Freund wrote: > Unless somebody else volunteers (please!), I guess I should write up a > patch... Maybe it doesn't have to be a patch -- we have some info on command lines to use for testing at https://wiki.postgresql.org/wiki/Meson#Test_related_commands which can perhaps b

Re: Buffer locking is special (hints, checksums, AIO writes)

2025-08-27 Thread Andres Freund
Hi, On 2025-08-26 17:14:49 -0700, Noah Misch wrote: > On Fri, Aug 22, 2025 at 03:44:48PM -0400, Andres Freund wrote: > > == Problem 2 - AIO writes vs exclusive locks == > > > > Separate from the hint bit issue, there is a second issue that I didn't > > have a > > good answer for: Making acquiring

Re: ABI Compliance Checker GSoC Project

2025-08-27 Thread David E. Wheeler
On Aug 26, 2025, at 17:43, Mankirat Singh wrote: > If ABI differences are found, you’ll see "log files for step > abi-compliance-check:"; if not, you’ll see "no abi diffs found in this run" > (example [3]). I’m quite happy to have a working build farm animal making these reports. Yesterday I

Re: Improve LWLock tranche name visibility across backends

2025-08-27 Thread Bertrand Drouvot
Hi, On Tue, Aug 26, 2025 at 05:50:34PM -0500, Sami Imseih wrote: > fixed the issues mentioned above in v13. > > > We probably need to do the sprintf/strcpy before LWLockNewTrancheId(). > > Also, I'm thinking we should just use the same tranche for both the DSA and > > the dshash table [0] to evad

Re: [PATCH] Generate random dates/times in a specified range

2025-08-27 Thread Dean Rasheed
On Mon, 25 Aug 2025 at 12:42, Damien Clochard wrote: > > Note that former random function variants are documented in > func/func-math.sgml but it felt more logical to document the new > variants in func-datetime.sgml. As a result the random variants would be > documented in 2 separate sections of

Re: Changing the state of data checksums in a running cluster

2025-08-27 Thread Tomas Vondra
On 8/27/25 13:00, Daniel Gustafsson wrote: >> On 27 Aug 2025, at 11:39, Tomas Vondra wrote: > >> Just to be clear - I don't see any pg_checksums failures either. I only >> see failures in the standby log, and I don't think the script checks >> that (it probably should). > > Right, that's what I'

Re: Potential problem in commit f777d773878 and 4f7f7b03758

2025-08-27 Thread Matheus Alcantara
On Tue Aug 26, 2025 at 3:26 AM -03, Dilip Kumar wrote: > On Tue, Aug 26, 2025 at 11:31 AM Dilip Kumar wrote: >> >> On Sun, Aug 24, 2025 at 5:59 PM Srinath Reddy Sadipiralla >> wrote: >> > >> > Hi, >> > Thanks Dilip and Matheus for working on this , i reviewed the >> > latest patch given my Matheu

Re: Changing the state of data checksums in a running cluster

2025-08-27 Thread Tomas Vondra
On 8/27/25 14:39, Tomas Vondra wrote: > ... > > And this happened on Friday: > > commit c13070a27b63d9ce4850d88a63bf889a6fde26f0 > Author: Alexander Korotkov > Date: Fri Aug 22 18:44:39 2025 +0300 > > Revert "Get rid of WALBufMappingLock" > > This reverts commit bc22dc0e0ddc2dcb6043a7

Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)

2025-08-27 Thread Kirill Reshke
On Sat, 2 Aug 2025 at 02:36, Melanie Plageman wrote: > > On Thu, Jul 31, 2025 at 6:58 PM Melanie Plageman > wrote: > > > > The patch "Set-pd_prune_xid-on-insert.txt" can be applied as the last > > patch in the set. It sets pd_prune_xid on insert (so pages filled by > > COPY or insert can also be

Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)

2025-08-27 Thread Melanie Plageman
Thanks for all the reviews. I'm working on responding to your previous mails with a new version. On Wed, Aug 27, 2025 at 8:55 AM Kirill Reshke wrote: > > v6-0015: > I chose to verify whether this single modification would be beneficial > on the HEAD. > > Benchmark I did: > > ``` > > \timing > CRE

Re: Parallel heap vacuum

2025-08-27 Thread Masahiko Sawada
On Tue, Aug 26, 2025 at 8:55 AM Melanie Plageman wrote: > > On Wed, Jul 23, 2025 at 12:06 PM Andres Freund wrote: > > > > On 2025-07-22 11:44:29 -0700, Masahiko Sawada wrote: > > > Do you think it makes sense to implement the above idea that we launch > > > parallel vacuum workers for heap throug

Re: psql: tab-completion support for COPY ... TO/FROM STDIN, STDOUT, and PROGRAM

2025-08-27 Thread Kirill Reshke
On Fri, 18 Jul 2025 at 12:49, Yugo Nagata wrote: > > On Thu, 17 Jul 2025 10:57:36 +0900 > Yugo Nagata wrote: > > > On Tue, 17 Jun 2025 00:08:32 +0900 > > Yugo Nagata wrote: > > > > > On Thu, 5 Jun 2025 16:52:00 +0900 > > > Yugo Nagata wrote: > > > > > > > On Thu, 5 Jun 2025 10:08:35 +0900 > > >

Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)

2025-08-27 Thread Melanie Plageman
On Tue, Aug 26, 2025 at 4:01 PM Kirill Reshke wrote: > > Few comments on 0003. > > 1) This patch introduces XLHP_HAS_VMFLAGS. However it lacks some > helpful comments about this new status bit. I added the ones you suggested in my v7 posted here [1]. > 2) Should we move conflict_xid = visibility

Re: Improve LWLock tranche name visibility across backends

2025-08-27 Thread Sami Imseih
Thanks for reviewing! > === 1 > > We need to check if tranche_name is NULL and report an error if that's the > case. > If not, strlen() would segfault. Added an error. Good call. The error message follows previously used convention. ``` + if (!tranche_name) + elog(ERROR, "tr

Re: Buffer locking is special (hints, checksums, AIO writes)

2025-08-27 Thread Noah Misch
On Wed, Aug 27, 2025 at 12:18:27PM -0400, Andres Freund wrote: > On 2025-08-26 17:14:49 -0700, Noah Misch wrote: > > On Fri, Aug 22, 2025 at 03:44:48PM -0400, Andres Freund wrote: > > > == Problem 3 - Cacheline contention == > > > > > c) Read accesses to the BufferDesc cause contention > > > > > >

Re: Buffer locking is special (hints, checksums, AIO writes)

2025-08-27 Thread Andres Freund
Hi, On 2025-08-27 12:14:41 -0700, Noah Misch wrote: > On Wed, Aug 27, 2025 at 12:18:27PM -0400, Andres Freund wrote: > > One way to do that would be to maintain a back-pointer from the BufferDesc > > to > > the BufferLookupEnt, since the latter *already* contains the BufferTag. We > > probably do

Re: Buffer locking is special (hints, checksums, AIO writes)

2025-08-27 Thread Robert Haas
On Wed, Aug 27, 2025 at 12:18 PM Andres Freund wrote: > Which would leave us with: > - reference (pins today) > - share > - share-exclusive > - exclusive > - cleanup > > This doesn't quite seem to map onto the heavyweight lock levels in a sensible > way... Could do: ACCESS SHARE, SHARE, SHARE UPD

Re: [PATCH] Let's get rid of the freelist and the buffer_strategy_lock

2025-08-27 Thread Greg Burd
On Aug 17 2025, at 12:57 am, Thomas Munro wrote: > On Sun, Aug 17, 2025 at 4:34 PM Thomas Munro wrote: >> Or if you don't like those odds, maybe it'd be OK to keep % but use it >> rarely and without the CAS that can fail. > > ... or if we wanted to try harder to avoid %, could we relegate it

Re: POC: enable logical decoding when wal_level = 'replica' without a server restart

2025-08-27 Thread Masahiko Sawada
On Wed, Aug 27, 2025 at 5:08 AM Hayato Kuroda (Fujitsu) wrote: > > Dear Sawada-san, > > Thanks for updating the patch. Here are my comments. Thank you for reviewing the patch! > > xlog_desc() > ``` > else if (info == XLOG_LOGICAL_DECODING_STATUS_CHANGE) > { > bool

Re: Serverside SNI support in libpq

2025-08-27 Thread Daniel Gustafsson
> On 13 May 2025, at 15:46, Andres Freund wrote: > This is not passing CI on windows... > https://cirrus-ci.com/build/4765059278176256 When looking into why the SNI tests failed on Windows I think I found a pre-existing issue that we didn't have tests for, which my patch added tests for and thus

Re: Changing the state of data checksums in a running cluster

2025-08-27 Thread Tomas Vondra
On 8/27/25 10:30, Daniel Gustafsson wrote: >> On 26 Aug 2025, at 01:06, Tomas Vondra wrote: > >> I think this TAP looks very nice, but there's a couple issues with it. >> See the attached patch fixing those. > > Thanks, I have incorporated (most of) your patch in the attached. I did keep > t

Re: plan shape work

2025-08-27 Thread Andrei Lepikhov
On 19/5/2025 20:01, Robert Haas wrote: Hope you find this interesting. If you do, let me know what you think.Thanks for looking in this direction! Since 2017, we designed features that should 'memorise' the experience of previous executions, checking the PlanState tree and instrumentation af

Re: Per backend relation statistics tracking

2025-08-27 Thread Bertrand Drouvot
Hi, On Tue, Aug 26, 2025 at 07:18:10AM -0400, Andres Freund wrote: > Hi, > > On 2025-08-26 06:38:41 +, Bertrand Drouvot wrote: > > > and IO related counters aren't > > > incremented remotely as often as the scan related counters are. > > > > You mean the flush are not triggered as often? If

Re: Adding REPACK [concurrently]

2025-08-27 Thread Antonin Houska
Mihail Nikalayeu wrote: > > A new kind of snapshot seems like (much) cleaner solution at the moment. > > Do you mean some kind of snapshot which only uses > TransactionIdDidCommit/Abort ignoring > TransactionIdIsCurrentTransactionId/TransactionIdIsInProgress? > Actually it behaves like SnapshotB

Re: Fix replica identity checks for MERGE command on published table.

2025-08-27 Thread Dean Rasheed
On Thu, 21 Aug 2025 at 04:41, Zhijie Hou (Fujitsu) wrote: > > On Friday, July 11, 2025 3:09 PM Dean Rasheed > wrote: > > > > In HEAD, it would be OK to change the signature of > > CheckValidResultRel() and pass it an onConflictAction argument to fix > > the ON CONFLICT DO UPDATE issue. However,

Re: [BUG?] check_exclusion_or_unique_constraint false negative

2025-08-27 Thread Mihail Nikalayeu
Hello, Amit! Amit Kapila : > Now, I > would like to know the opinion of others who were involved in the > initial commit, so added Peter E. to see what he thinks of the same. Seems like you added another Peter in [0] - I added Peter Eisentraut :) > > Hmm Yes - if the TID lands to the page l

Mark ItemPointer parameters as const in tuple/table lock functions

2025-08-27 Thread Chao Li
Hi Hackers, This is a pure refactor patch. The functions LockTuple, ConditionalLockTuple, UnlockTuple, and XactLockTableWait take an ItemPointer parameter named 'tid'. Since these functions do not modify the tuple identifier, the parameter should be declared as const to better convey intent and a

Re: Mark ItemPointer parameters as const in tuple/table lock functions

2025-08-27 Thread Peter Eisentraut
On 27.08.25 10:57, Chao Li wrote: This is a pure refactor patch. The functions LockTuple, ConditionalLockTuple, UnlockTuple, and XactLockTableWait take an ItemPointer parameter named 'tid'. Since these functions do not modify the tuple identifier, the parameter should be declared as const to

Re: pgsql: oauth: Add unit tests for multiplexer handling

2025-08-27 Thread Christoph Berg
Re: Jacob Champion > Committed and backpatched. Thanks again! The apt.pg.o build is already happy again, thanks! https://jengus.postgresql.org/job/postgresql-19-binaries-snapshot/ Christoph

Re: Adding REPACK [concurrently]

2025-08-27 Thread Mihail Nikalayeu
Antonin Houska : > Do you mean the race related to TransactionIdIsInProgress()? Not sure I > understand, as you suggested above that you no longer need the function. The "lightweight" approaches I see so far: * XactLockTableWait before replay + SnapshotSelf(GetLatestSnapshot?) * SnapshotDirty + r

RE: POC: enable logical decoding when wal_level = 'replica' without a server restart

2025-08-27 Thread Hayato Kuroda (Fujitsu)
Dear Sawada-san, Thanks for updating the patch. Here are my comments. xlog_desc() ``` else if (info == XLOG_LOGICAL_DECODING_STATUS_CHANGE) { boolenabled; memcpy(&enabled, rec, sizeof(bool)); appendStringInfo(buf, enable

Re: [WiP] B-tree page merge during vacuum to reduce index bloat

2025-08-27 Thread Peter Geoghegan
On Tue, Aug 26, 2025 at 5:40 AM Andrey Borodin wrote: > *** Correctness: > > The implementation reuses existing locking, critical sections and WAL logging > infrastructure. To handle cross-page dependencies during WAL replay, when > tuples are merged, the right sibling buffer is registered with