Re: BufferAlloc: don't take two simultaneous locks

2022-03-13 Thread Kyotaro Horiguchi
At Mon, 14 Mar 2022 09:39:48 +0900 (JST), Kyotaro Horiguchi wrote in > I'll examine the possibility to resolve this... The existence of nfree and nalloc made me confused and I found the reason. In the case where a parittion collects many REUSE-ASSIGN-REMOVEed elemetns from other paritiotns,

Re: add checkpoint stats of snapshot and mapping files of pg_logical dir

2022-03-13 Thread Bharath Rupireddy
On Mon, Mar 14, 2022 at 10:45 AM Michael Paquier wrote: > > On Sun, Mar 13, 2022 at 02:58:58PM -0700, Nathan Bossart wrote: > > On Sun, Mar 13, 2022 at 01:54:10PM +0530, Bharath Rupireddy wrote: > >> Another thing I added in v2 is to not emit snapshot and mapping files > >> stats in case of

Re: add checkpoint stats of snapshot and mapping files of pg_logical dir

2022-03-13 Thread Michael Paquier
On Sun, Mar 13, 2022 at 02:58:58PM -0700, Nathan Bossart wrote: > On Sun, Mar 13, 2022 at 01:54:10PM +0530, Bharath Rupireddy wrote: >> Another thing I added in v2 is to not emit snapshot and mapping files >> stats in case of restartpoint as logical decoding isn't supported on >> standbys, so it

Re: pg_ls_tmpdir to show directories and shared filesets (and pg_ls_*)

2022-03-13 Thread Michael Paquier
On Wed, Mar 09, 2022 at 10:50:45AM -0600, Justin Pryzby wrote: > I also changed pg_ls_dir_recurse() to handle concurrent removal of a dir, > which > I noticed caused an infrequent failure on CI. However I'm not including that > here, since the 2nd half of the patch set seems isn't ready due to

Re: Removing more vacuumlazy.c special cases, relfrozenxid optimizations

2022-03-13 Thread Peter Geoghegan
On Fri, Feb 25, 2022 at 5:52 PM Peter Geoghegan wrote: > There is an important practical way in which it makes sense to treat > 0001 as separate to 0002. It is true that 0001 is independently quite > useful. In practical terms, I'd be quite happy to just get 0001 into > Postgres 15, without 0002.

Re: Allow async standbys wait for sync replication

2022-03-13 Thread Kyotaro Horiguchi
At Mon, 14 Mar 2022 11:30:02 +0900 (JST), Kyotaro Horiguchi wrote in > At Sat, 12 Mar 2022 14:33:32 -0800, Nathan Bossart > wrote in > > On Tue, Mar 08, 2022 at 06:01:23PM -0800, Andres Freund wrote: > > > To me it's architecturally the completely wrong direction. We should move > > > in >

Re: Allow async standbys wait for sync replication

2022-03-13 Thread Kyotaro Horiguchi
At Sat, 12 Mar 2022 14:33:32 -0800, Nathan Bossart wrote in > On Tue, Mar 08, 2022 at 06:01:23PM -0800, Andres Freund wrote: > > To me it's architecturally the completely wrong direction. We should move in > > the *other* direction, i.e. allow WAL to be sent to standbys before the > > primary

Re: On login trigger: take three

2022-03-13 Thread Andres Freund
On 2022-03-13 20:35:44 -0400, Tom Lane wrote: > Andres Freund writes: > > I was thinking that the way to use it would be to specify it as a client > > option. Like PGOPTIONS='-c ignore_event_trigger=login' psql. > > Ugh ... that would allow people (at least superusers) to bypass > the login

Re: pg_walinspect - a new extension to get raw WAL data and WAL stats

2022-03-13 Thread Kyotaro Horiguchi
At Fri, 11 Mar 2022 15:39:13 -0500, Robert Haas wrote in > On Thu, Mar 10, 2022 at 9:38 PM Kyotaro Horiguchi > wrote: > > It seems to me too rigorous that pg_get_wal_records_info/stats() > > reject future LSNs as end-LSN and I think WARNING or INFO and stop at > > the real end-of-WAL is more

Re: Add index scan progress to pg_stat_progress_vacuum

2022-03-13 Thread Masahiko Sawada
On Sat, Mar 12, 2022 at 4:00 PM Imseih (AWS), Sami wrote: > > > nitpick: Can we remove the extra spaces in the parentheses? > > fixed > > > What does it mean if there isn't an entry in the map? Is this actually > > expected, or should we ERROR instead? > > I cleaned up the code here and added

Re: BufferAlloc: don't take two simultaneous locks

2022-03-13 Thread Kyotaro Horiguchi
At Fri, 11 Mar 2022 12:34:32 +0300, Yura Sokolov wrote in > В Пт, 11/03/2022 в 15:49 +0900, Kyotaro Horiguchi пишет: > > At Fri, 11 Mar 2022 15:30:30 +0900 (JST), Kyotaro Horiguchi > > > BufTableDelete(BufferTag *tagPtr, uint32 hashcode, bool > > reuse) > > > > BufTableDelete considers both

Re: BufferAlloc: don't take two simultaneous locks

2022-03-13 Thread Kyotaro Horiguchi
At Fri, 11 Mar 2022 11:30:27 +0300, Yura Sokolov wrote in > В Пт, 11/03/2022 в 15:30 +0900, Kyotaro Horiguchi пишет: > > At Thu, 03 Mar 2022 01:35:57 +0300, Yura Sokolov > > wrote in > > > В Вт, 01/03/2022 в 10:24 +0300, Yura Sokolov пишет: > > > > Ok, here is v4. > > > > > > And here is

Re: On login trigger: take three

2022-03-13 Thread Tom Lane
Andres Freund writes: > I was thinking that the way to use it would be to specify it as a client > option. Like PGOPTIONS='-c ignore_event_trigger=login' psql. Ugh ... that would allow people (at least superusers) to bypass the login trigger at will, which seems to me to break a lot of the

Re: On login trigger: take three

2022-03-13 Thread Andres Freund
Hi, On 2022-03-13 19:57:08 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2022-03-13 23:31:03 +0100, Daniel Gustafsson wrote: > >> Something like a '-c ignore_event_trigger=' GUC perhaps? > > > Did you mean login instead of event? > > > Something like it would work for me. It probably

Re: On login trigger: take three

2022-03-13 Thread Tom Lane
Andres Freund writes: > On 2022-03-13 23:31:03 +0100, Daniel Gustafsson wrote: >> Something like a '-c ignore_event_trigger=' GUC perhaps? > Did you mean login instead of event? > Something like it would work for me. It probably should be > GUC_DISALLOW_IN_FILE? Why? Inserting such a setting

Re: Tab completion not listing schema list for create/alter publication for all tables in schema

2022-03-13 Thread Tom Lane
vignesh C writes: > Here "pg_%" should be "pg_%%". Right you are. Patch pushed, thanks! regards, tom lane

Re: On login trigger: take three

2022-03-13 Thread Andres Freund
Hi, On 2022-03-13 23:31:03 +0100, Daniel Gustafsson wrote: > > On 12 Mar 2022, at 03:46, Andres Freund wrote: > > >> + > >> + The login event occurs when a user logs in to the > >> + system. > >> + Any bugs in a trigger procedure for this event may prevent successful > >> +

Re: BufferAlloc: don't take two simultaneous locks

2022-03-13 Thread Zhihong Yu
On Sun, Mar 13, 2022 at 3:27 PM Yura Sokolov wrote: > В Вс, 13/03/2022 в 07:05 -0700, Zhihong Yu пишет: > > > > Hi, > > In the description: > > > > There is no need to hold both lock simultaneously. > > > > both lock -> both locks > > Thanks. > > > +* We also reset the usage_count since any

Re: On login trigger: take three

2022-03-13 Thread Daniel Gustafsson
> On 12 Mar 2022, at 03:46, Andres Freund wrote: >> + >> + The login event occurs when a user logs in to the >> + system. >> + Any bugs in a trigger procedure for this event may prevent successful >> + login to the system. Such bugs may be fixed after first restarting the >> +

Re: BufferAlloc: don't take two simultaneous locks

2022-03-13 Thread Yura Sokolov
В Вс, 13/03/2022 в 07:05 -0700, Zhihong Yu пишет: > > Hi, > In the description: > > There is no need to hold both lock simultaneously. > > both lock -> both locks Thanks. > +* We also reset the usage_count since any recency of use of the old > > recency of use -> recent use Thanks. >

Re: add checkpoint stats of snapshot and mapping files of pg_logical dir

2022-03-13 Thread Nathan Bossart
On Sun, Mar 13, 2022 at 01:54:10PM +0530, Bharath Rupireddy wrote: > Thanks for reviewing this. I agree with all of the above suggestions > and incorporated them in the v2 patch. Thanks for the new patch. > Another thing I added in v2 is to not emit snapshot and mapping files > stats in case of

Re: SQL/JSON: JSON_TABLE

2022-03-13 Thread Andrew Dunstan
On 2/9/22 08:22, Himanshu Upadhyaya wrote: > On Wed, Feb 2, 2022 at 12:44 AM Andrew Dunstan wrote: >> >> rebased with some review comments attended to. > I am in process of reviewing these patches, initially, have started > with 0002-JSON_TABLE-v55.patch. > Tested many different scenarios with

Re: Issue with pg_stat_subscription_stats

2022-03-13 Thread Melanie Plageman
On Sat, Mar 12, 2022 at 3:15 PM Andres Freund wrote: > > Hi, > > On 2022-03-12 08:28:35 +0530, Amit Kapila wrote: > > On Sat, Mar 12, 2022 at 2:14 AM Melanie Plageman > > wrote: > > > > > > So, I noticed that pg_stat_reset_subscription_stats() wasn't working > > > properly, and, upon further

Tab completion not listing schema list for create/alter publication for all tables in schema

2022-03-13 Thread vignesh C
Hi, I noticed that the following commands "CREATE PUBLICATION pub1 FOR ALL TABLES IN SCHEMA" and "ALTER PUBLICATION pub1 ADD ALL TABLES IN SCHEMA" does not complete with the schema list. I feel this is because of the following code in tab-complete.c: .

Re: BufferAlloc: don't take two simultaneous locks

2022-03-13 Thread Zhihong Yu
On Sun, Mar 13, 2022 at 3:25 AM Yura Sokolov wrote: > В Пт, 11/03/2022 в 17:21 +0900, Kyotaro Horiguchi пишет: > > At Fri, 11 Mar 2022 15:49:49 +0900 (JST), Kyotaro Horiguchi < > horikyota@gmail.com> wrote in > > > At Fri, 11 Mar 2022 15:30:30 +0900 (JST), Kyotaro Horiguchi < >

Re: Support logical replication of DDLs

2022-03-13 Thread Dilip Kumar
On Mon, Feb 21, 2022 at 9:43 PM Zheng Li wrote: > > Hello, > > One of the most frequently requested improvements from our customers > is to reduce downtime associated with software updates (both major and > minor versions). To do this, we have reviewed potential contributions to > improving

Re: Add id's to various elements in protocol.sgml

2022-03-13 Thread Brar Piening
On 09.03.2022 at 20:43, Brar Piening wrote: Attached is a pretty huge patch that adds ids to all sections and all the varlistentries where the containing variablelist already had at least one id (plus a few additional ones that I stumbled upon and deemed useful). It also adds html links next to

Re: BufferAlloc: don't take two simultaneous locks

2022-03-13 Thread Yura Sokolov
В Пт, 11/03/2022 в 17:21 +0900, Kyotaro Horiguchi пишет: > At Fri, 11 Mar 2022 15:49:49 +0900 (JST), Kyotaro Horiguchi > wrote in > > At Fri, 11 Mar 2022 15:30:30 +0900 (JST), Kyotaro Horiguchi > > wrote in > > > Thanks! I looked into dynahash part. > > > > > > struct HASHHDR > > > { > >

Re: Defer selection of asynchronous subplans until the executor initialization stage

2022-03-13 Thread Etsuro Fujita
Hi Alexander, On Wed, Sep 15, 2021 at 3:40 PM Alexander Pyhalov wrote: > Etsuro Fujita писал 2021-08-30 12:52: > > To allow async execution in a bit more cases, I modified the patch a > > bit further: a ProjectionPath put directly above an async-capable > > ForeignPath would also be considered

Re: postgres_fdw: commit remote (sub)transactions in parallel during pre-commit

2022-03-13 Thread Etsuro Fujita
On Sat, Mar 12, 2022 at 10:02 AM David Zhang wrote: > Applied patches v6-0002 and v6-0003 to master branch, and the `make check` > test is ok. > > Here is my test result in 10 times average on 3 virtual machines: > before the patches: > > abort.1 = 2.5473 ms > > abort.2 = 4.1572 ms > > after the

Re: add checkpoint stats of snapshot and mapping files of pg_logical dir

2022-03-13 Thread Bharath Rupireddy
On Sat, Mar 12, 2022 at 1:35 AM Nathan Bossart wrote: > > +CheckpointStats.repl_map_cutoff_lsn = cutoff; > > Could we set repl_map_cutoff_lsn closer to where it is calculated? Right > now, it's set at the bottom of the function just before the directory is > freed. Is there a strong reason