Remaining references to RecentGlobalXmin

2021-05-23 Thread Michael Paquier
Hi, dc7420c2 has removed RecentGlobalXmin, but there are still references to it in the code, and a set of FIXME references, like this one in autovacuum.c (three in total): /* * Start a transaction so we can access pg_database, and get a snapshot. * We don't have a use for the snapshot itself, bu

RE: Forget close an open relation in ReorderBufferProcessTXN()

2021-05-23 Thread osumi.takami...@fujitsu.com
On Monday, May 24, 2021 12:57 PM I wrote: > On Monday, May 24, 2021 12:23 PM Amit Langote > wrote: > > On Mon, May 24, 2021 at 12:16 PM osumi.takami...@fujitsu.com > > wrote: > > > When I execute make check-world with v6 additionally, I've gotten > > > another failure. I get this about once in >

Test of a partition with an incomplete detach has a timing issue

2021-05-23 Thread osumi.takami...@fujitsu.com
Hi During my review of a patch in the community, I've encountered failures of OSS HEAD'S make check-world in a continuous loop. I just repeated make check-world. Accordingly, this should be an existing issue. Make check-world fails once in about 20 times in my env. I'd like to report this. The

Re: Teaching users how they can get the most out of HOT in Postgres 14

2021-05-23 Thread Masahiko Sawada
On Wed, May 19, 2021 at 6:09 AM Peter Geoghegan wrote: > > On Tue, May 18, 2021 at 7:29 AM Masahiko Sawada wrote: > > If this skipping > > behavior badly affects other indexes AMs, this optimization should be > > considered within btree indexes, although we will need a way for index > > AMs to co

Re: Move pg_attribute.attcompression to earlier in struct for reduced size?

2021-05-23 Thread Dilip Kumar
On Mon, May 24, 2021 at 9:39 AM Michael Paquier wrote: > > On Fri, May 21, 2021 at 02:19:29PM -0700, Andres Freund wrote: > > During VACUUM FULL reform_and_rewrite_tuple() detoasts the old value if > > it was compressed with a different method, while in > > TopTransactionContext. There's nothing f

Re: Move pg_attribute.attcompression to earlier in struct for reduced size?

2021-05-23 Thread Dilip Kumar
On Fri, May 21, 2021 at 8:31 PM Tom Lane wrote: > > > if (rel->rd_rel->relkind == RELKIND_RELATION || > rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) > > This seems fairly nuts; in particular, why are matviews excluded? The matviews are excluded only in "ATExecAddColumn()" right?

Re: Logical Replication - behavior of TRUNCATE ... CASCADE

2021-05-23 Thread Amit Kapila
On Sat, May 22, 2021 at 10:33 AM Dilip Kumar wrote: > > On Thu, May 20, 2021 at 5:03 PM Amit Kapila wrote: > > > > On Fri, May 7, 2021 at 6:06 PM Dilip Kumar wrote: > > > > > > On Mon, May 3, 2021 at 6:08 PM Bharath Rupireddy > > > wrote: > > > > > > > > Having said that, isn't it good if we ca

Re: [PATCH] Add `truncate` option to subscription commands

2021-05-23 Thread Amit Kapila
On Sat, May 22, 2021 at 9:58 AM Bharath Rupireddy wrote: > > On Thu, Nov 26, 2020 at 12:16 AM David Christensen wrote: > > > > Hi, > > > > At this time I do not have time to make the necessary changes for this > > commitfest so I am voluntarily withdrawing this patch, but will > > revisit at a fu

Re: Re: Parallel scan with SubTransGetTopmostTransaction assert coredump

2021-05-23 Thread Greg Nancarrow
On Mon, May 24, 2021 at 2:50 PM Michael Paquier wrote: > > On Mon, May 24, 2021 at 12:04:37PM +1000, Greg Nancarrow wrote: > > Keep cfbot happy, use the PG14 patch as latest. > > This stuff is usually very tricky. Agreed. That's why I was looking for experts in this snapshot-handling code, to loo

Re: Move pg_attribute.attcompression to earlier in struct for reduced size?

2021-05-23 Thread Tom Lane
Michael Paquier writes: > On Sun, May 23, 2021 at 12:25:10PM -0400, Tom Lane wrote: >> While I've not actually tested this, it seems to me that we could >> just drop these relkind tests altogether. It won't hurt anything >> to set up attcompression in relation descriptors where it'll never >> be

Re: Race condition in recovery?

2021-05-23 Thread Dilip Kumar
On Mon, May 24, 2021 at 10:17 AM Kyotaro Horiguchi wrote: > > At Sun, 23 May 2021 21:37:58 +0530, Dilip Kumar wrote > in > > On Sun, May 23, 2021 at 2:19 PM Dilip Kumar wrote: > > > > > > On Sat, May 22, 2021 at 8:33 PM Robert Haas wrote: > > > > I have created a tap test based on Robert's tes

Re: locking [user] catalog tables vs 2pc vs logical rep

2021-05-23 Thread Michael Paquier
On Mon, Feb 22, 2021 at 02:28:47PM -0800, Andres Freund wrote: > Perhaps all that we need to do is to disallow 2PC prepare if [user] > catalog tables have been locked exclusively? Similar to how we're > disallowing preparing tables with temp table access. At least for anything involving critical r

Re: Re: Parallel scan with SubTransGetTopmostTransaction assert coredump

2021-05-23 Thread Michael Paquier
On Mon, May 24, 2021 at 12:04:37PM +1000, Greg Nancarrow wrote: > Keep cfbot happy, use the PG14 patch as latest. This stuff is usually very tricky. Do we have a way to reliably reproduce the report discussed here? -- Michael signature.asc Description: PGP signature

Re: Race condition in recovery?

2021-05-23 Thread Kyotaro Horiguchi
At Sun, 23 May 2021 21:37:58 +0530, Dilip Kumar wrote in > On Sun, May 23, 2021 at 2:19 PM Dilip Kumar wrote: > > > > On Sat, May 22, 2021 at 8:33 PM Robert Haas wrote: > > I have created a tap test based on Robert's test.sh script. It > reproduces the issue. I am new with perl so this stil

Re: Move pg_attribute.attcompression to earlier in struct for reduced size?

2021-05-23 Thread Michael Paquier
On Sun, May 23, 2021 at 12:25:10PM -0400, Tom Lane wrote: > While I've not actually tested this, it seems to me that we could > just drop these relkind tests altogether. It won't hurt anything > to set up attcompression in relation descriptors where it'll never > be consulted. Wouldn't it be conf

Re: Replication slot stats misgivings

2021-05-23 Thread vignesh C
On Mon, May 24, 2021 at 9:38 AM Amit Kapila wrote: > > On Thu, May 13, 2021 at 11:30 AM vignesh C wrote: > > > > Do we want to update the information about pg_stat_replication_slots > at the following place in docs > https://www.postgresql.org/docs/devel/logicaldecoding-catalogs.html? > > If so,

Re: locking [user] catalog tables vs 2pc vs logical rep

2021-05-23 Thread Amit Kapila
On Tue, Apr 20, 2021 at 9:57 AM vignesh C wrote: > > This similar problem exists in case of synchronous replication setup > having synchronous_standby_names referring to the subscriber, when we > do the steps "begin;lock pg_class; insert into test1 values(10); > commit". In this case while decodin

Re: Move pg_attribute.attcompression to earlier in struct for reduced size?

2021-05-23 Thread Michael Paquier
On Fri, May 21, 2021 at 02:19:29PM -0700, Andres Freund wrote: > During VACUUM FULL reform_and_rewrite_tuple() detoasts the old value if > it was compressed with a different method, while in > TopTransactionContext. There's nothing freeing that until > TopTransactionContext ends - obviously not gre

Re: Replication slot stats misgivings

2021-05-23 Thread Amit Kapila
On Thu, May 13, 2021 at 11:30 AM vignesh C wrote: > Do we want to update the information about pg_stat_replication_slots at the following place in docs https://www.postgresql.org/docs/devel/logicaldecoding-catalogs.html? If so, feel free to submit the patch for it? -- With Regards, Amit Kapila

RE: Forget close an open relation in ReorderBufferProcessTXN()

2021-05-23 Thread osumi.takami...@fujitsu.com
On Monday, May 24, 2021 12:23 PM Amit Langote wrote: > On Mon, May 24, 2021 at 12:16 PM osumi.takami...@fujitsu.com > wrote: > > When I execute make check-world with v6 additionally, I've gotten > > another failure. I get this about once in > > 20 times of make check-world with v6. > Hmm, I doubt

Re: Forget close an open relation in ReorderBufferProcessTXN()

2021-05-23 Thread Amit Langote
On Mon, May 24, 2021 at 12:16 PM osumi.takami...@fujitsu.com wrote: > On Saturday, May 22, 2021 11:58 AM Amit Langote > wrote: > > On Sat, May 22, 2021 at 11:00 AM osumi.takami...@fujitsu.com > > wrote: > > > I've checked the core file of v3's failure core and printed the entry > > > to get mor

RE: Forget close an open relation in ReorderBufferProcessTXN()

2021-05-23 Thread osumi.takami...@fujitsu.com
On Saturday, May 22, 2021 11:58 AM Amit Langote wrote: > On Sat, May 22, 2021 at 11:00 AM osumi.takami...@fujitsu.com > wrote: > > I've checked the core file of v3's failure core and printed the entry > > to get more confidence. Sorry for inappropriate measure to verify the > solution. > > > > $1

Re: Race condition in recovery?

2021-05-23 Thread Kyotaro Horiguchi
At Fri, 21 May 2021 12:52:54 -0400, Robert Haas wrote in > I had trouble following it completely, but I didn't really spot > anything that seemed definitely wrong. However, I don't understand > what it has to do with where we are now. What I want to understand is: > under exactly what circumstan

Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors

2021-05-23 Thread Yugo NAGATA
Hi hackers, On Tue, 10 Mar 2020 09:48:23 +1300 Thomas Munro wrote: > On Tue, Mar 10, 2020 at 8:43 AM Fabien COELHO wrote: > > >> Thank you very much! I'm going to send a new patch set until the end of > > >> this week (I'm sorry I was very busy in the release of Postgres Pro > > >> 11...). > >

Re: Re: Parallel scan with SubTransGetTopmostTransaction assert coredump

2021-05-23 Thread Greg Nancarrow
On Thu, May 20, 2021 at 4:08 PM Greg Nancarrow wrote: > Keep cfbot happy, use the PG14 patch as latest. Regards, Greg Nancarrow Fujitsu Australia v2-0001-PG14-Fix-parallel-worker-failed-assertion-and-coredump.patch Description: Binary data

Re: Refactor "mutually exclusive options" error reporting code in parse_subscription_options

2021-05-23 Thread Michael Paquier
On Sat, May 22, 2021 at 01:47:24PM +0530, Bharath Rupireddy wrote: > Thanks. I think using bitmaps would help us have clean code. This is > also more extensible. See pseudo code at [1]. One disadvantage is that > we might have bms_XXXfunction calls, but that's okay and it shouldn't > add too much t

RE: Skip partition tuple routing with constant partition key

2021-05-23 Thread houzj.f...@fujitsu.com
From: Amit Langote Sent: Thursday, May 20, 2021 8:23 PM > > Hou-san, > > On Thu, May 20, 2021 at 7:35 PM houzj.f...@fujitsu.com > wrote: > > 2) Test expression in partition key > > > > create or replace function partition_func(i int) returns int as $$ > > begin > > return i; > >

Re: Force disable of SSL renegociation in the server

2021-05-23 Thread Michael Paquier
On Fri, May 21, 2021 at 10:41:34AM +0900, Michael Paquier wrote: > This one can be set within ssl->s3->flags in the port information. > Still that's not completely feasable either as some versions of > OpenSSL hide the internals of a bunch of internal structures, and some > distributions patch the

Re: CALL versus procedures with output-only arguments

2021-05-23 Thread Tom Lane
I wrote: > I think we ought to fix this so that OUT-only arguments are ignored > when calling from SQL not plpgsql. I'm working on a patch to make it act that way. I've got some issues yet to fix with named arguments (which seem rather undertested BTW, since the patch is passing check-world even

Re: Removed extra memory allocations from create_list_bounds

2021-05-23 Thread Justin Pryzby
On Sun, May 23, 2021 at 10:40:16PM +0530, Nitin Jadhav wrote: > I have used the same testing procedure as explained in the previous mail. > Please find the timing information of the last 10 creation of partitioned > tables as given below. > Without patch With 0001 and 0002 With all patch ... > 18.

Re: Removed extra memory allocations from create_list_bounds

2021-05-23 Thread Nitin Jadhav
> > I think some of my patches could *increase* memory use, due to power-of-two > > allocation logic. I think it's still a good idea, since it doesn't seem to be > > the dominant memory allocation. > > I don't think that it will increase performance rather it adds to the improvement. Sorry. Kindl

Re: Removed extra memory allocations from create_list_bounds

2021-05-23 Thread Nitin Jadhav
> I see this as a code cleanup more than an performance optimization. I agree with this. This is like a code cleanup but it also improves performance. I have done the performance testing, Just to confirm whether it really improves performance. > I think some of my patches could *increase* memory

Re: Move pg_attribute.attcompression to earlier in struct for reduced size?

2021-05-23 Thread Tom Lane
I wrote: > I think we need to do more than that. It's certainly not okay to > leave catalogs.sgml out of sync with reality. And maybe I'm just > an overly anal-retentive sort, but I think that code that manipulates > tuples ought to match the declared field order if there's not some > specific re

Re: Race condition in recovery?

2021-05-23 Thread Dilip Kumar
On Sun, May 23, 2021 at 2:19 PM Dilip Kumar wrote: > > On Sat, May 22, 2021 at 8:33 PM Robert Haas wrote: I have created a tap test based on Robert's test.sh script. It reproduces the issue. I am new with perl so this still needs some cleanup/improvement, but at least it shows the idea. -- R

Re: Fixing the docs for ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION

2021-05-23 Thread Mark Dilger
> On May 22, 2021, at 10:40 PM, Bharath Rupireddy > wrote: > > I think, for the docs part we can move the discussion to the thread > [1], if you are okay, and have the error message discussion here. > > [1] - > https://www.postgresql.org/message-id/flat/CALDaNm34qugTr5M0d1JgCgk2Qdo6LZ9UEbTB

Re: Added missing tab completion for alter subscription set option

2021-05-23 Thread vignesh C
On Wed, May 19, 2021 at 2:03 PM Bharath Rupireddy < bharath.rupireddyforpostg...@gmail.com> wrote: > > On Tue, May 18, 2021 at 9:21 PM Alvaro Herrera wrote: > > > > On 2021-May-14, vignesh C wrote: > > > > > While I was reviewing one of the logical decoding features, I found > > > Streaming and bi

Re: Added missing tab completion for alter subscription set option

2021-05-23 Thread vignesh C
On Thu, May 20, 2021 at 9:40 PM Tom Lane wrote: > > vignesh C writes: > > On Tue, May 18, 2021 at 9:20 PM Alvaro Herrera > > wrote: > >> I wish we didn't have to keep knowledge in the psql source on which > >> option names are to be used for each command. If we had some function > >> SELECT pg

Re: Buildfarm latest links

2021-05-23 Thread Magnus Hagander
On Sat, May 22, 2021 at 11:50 PM Andrew Dunstan wrote: > > > On 5/22/21 5:42 PM, Magnus Hagander wrote: > > > > > > On Sat, May 22, 2021, 23:40 Andrew Dunstan > > wrote: > > > > > > On 5/22/21 4:20 PM, Magnus Hagander wrote: > > > Our website links to: > >

Re: RelOptInfo.all_partrels does not seem to do very much

2021-05-23 Thread David Rowley
On Sun, 23 May 2021 at 19:01, David Rowley wrote: > I was just looking at RelOptInfo's partitioning fields and noticed > that all_partrels seems to be set in a couple of places but never > actually referenced. Looks like I misread the code. It is used. Apologies for the noise. David

Re: Multi-Column List Partitioning

2021-05-23 Thread Nitin Jadhav
> Yes, it would be nice to have this. Thanks for picking this up. Thanks for confirming. > Some quick observations: Thanks for providing the comments. I will handle these cases. > Hmm, why not have parentheses around these lists, that is: ( > (list_of_values) [, ...] ) > > So your example woul

Re: Race condition in recovery?

2021-05-23 Thread Dilip Kumar
On Sat, May 22, 2021 at 8:33 PM Robert Haas wrote: > > For my original case, both standby1 and standby2 are connected to the > > primary. Now, standby1 is promoted and standby2 is shut down. And, > > before restarting, all the local WAL of the standby2 is removed so > > that it can follow the ne

Re: Subscription tests fail under CLOBBER_CACHE_ALWAYS

2021-05-23 Thread Michael Paquier
On Sun, May 23, 2021 at 02:05:59PM +0900, Amit Langote wrote: > On Sun, May 23, 2021 at 10:28 AM Tom Lane wrote: >> I wrote: >> > ... wrong. Running v13 branch tip under CLOBBER_CACHE_ALWAYS provokes >> > a core dump in 013_partition.pl, so 1375422c is not to blame. Now >> > I'm wondering how fa

RelOptInfo.all_partrels does not seem to do very much

2021-05-23 Thread David Rowley
Hi, I was just looking at RelOptInfo's partitioning fields and noticed that all_partrels seems to be set in a couple of places but never actually referenced. The field was added in c8434d64c - Allow partitionwise joins in more cases for PG13. Maybe it did something during the development of that