Re: A new function to wait for the backend exit after termination

2021-03-16 Thread Bharath Rupireddy
On Tue, Mar 16, 2021 at 9:48 PM Magnus Hagander wrote: > Does it really make sense that pg_wait_for_backend_termination() > defaults to waiting *100 milliseconds*, and then logs a warning? That > seems extremely short if I'm explicitly asking it to wait. I increased the default wait timeout to 5s

Re: cleanup temporary files after crash

2021-03-16 Thread Euler Taveira
On Sun, Mar 14, 2021, at 11:01 PM, Thomas Munro wrote: > On Wed, Mar 10, 2021 at 1:31 AM Michael Paquier wrote: > > On Tue, Mar 09, 2021 at 02:28:43AM +0100, Tomas Vondra wrote: > > > Let's move this patch forward. Based on the responses, I agree the > > > default behavior should be to remove the

Re: crash during cascaded foreign key update

2021-03-16 Thread Amit Langote
On Tue, Mar 16, 2021 at 11:17 PM Tom Lane wrote: > Amit Langote writes: > > With HEAD (I think v12 and greater), I see $subject when trying out > > the following scenario: > > I wonder if this is related to > > https://www.postgresql.org/message-id/flat/89429.1584443208%40antos > > which we've st

Re: Consider Parallelism While Planning For REFRESH MATERIALIZED VIEW

2021-03-16 Thread Thomas Munro
On Tue, Mar 16, 2021 at 2:41 PM Thomas Munro wrote: > On Mon, Mar 15, 2021 at 8:25 PM Bharath Rupireddy > wrote: > > > > The problem with a case like REFRESH MATERIALIZED VIEW is that there's > > > > nothing to prevent something that gets run in the course of the query > > > > from trying to acce

RE: libpq debug log

2021-03-16 Thread tsunakawa.ta...@fujitsu.com
Alvaro-san, Thank you for taking your time to take a look at an incomplete patch. I thought I would ask you for final check for commit after Iwata-san has reflected my review comments. I discussed with Iwata-sn your below comments. Let me convey her opinions. (She is now focusing on fixing

Re: Getting better results from valgrind leak tracking

2021-03-16 Thread Andres Freund
Hi, David, there's a question about a commit of yours below, hence adding you. On 2021-03-16 19:36:10 -0400, Tom Lane wrote: > Out of curiosity I poked at this for a little while. Cool. > It doesn't appear to me that we leak much at all, at least not if you > are willing to take "still reachab

Re: Should we improve "PID XXXX is not a PostgreSQL server process" warning for pg_terminate_backend(<>)?

2021-03-16 Thread torikoshia
On 2021-03-16 20:51, Bharath Rupireddy wrote: On Mon, Mar 15, 2021 at 11:23 AM torikoshia wrote: On 2021-03-07 19:16, Bharath Rupireddy wrote: > On Fri, Feb 5, 2021 at 5:15 PM Bharath Rupireddy > wrote: >> >> pg_terminate_backend and pg_cancel_backend with postmaster PID produce >> "PID

Re: [HACKERS] logical decoding of two-phase transactions

2021-03-16 Thread vignesh C
On Tue, Mar 16, 2021 at 7:22 PM Amit Kapila wrote: > > On Tue, Mar 16, 2021 at 6:22 PM vignesh C wrote: > > > > On Mon, Mar 15, 2021 at 6:14 PM Ajin Cherian wrote: > > > > > > On Mon, Mar 15, 2021 at 2:04 PM Amit Kapila > > > wrote: > > >> > > > > 2) table_states_not_ready global variable is u

Re: Getting better results from valgrind leak tracking

2021-03-16 Thread Zhihong Yu
Hi, For the second last trace involving SearchCatCacheList (catcache.c:1691), the ctlist's members are stored in cl->members array where cl is returned at the end of SearchCatCacheList. Maybe this was not accounted for by valgrind ? Cheers On Tue, Mar 16, 2021 at 7:31 PM Andres Freund wrote: >

Re: A new function to wait for the backend exit after termination

2021-03-16 Thread Kyotaro Horiguchi
At Wed, 17 Mar 2021 07:01:39 +0530, Bharath Rupireddy wrote in > Attaching v10 patch for further review. The time-out mechanism doesn't count remainingtime as expected, concretely it does the following. do { kill(); WaitLatch(WL_LATCH_SET | WL_TIMEOUT | WL_EXIT_ON_PM_DEATH, waittime); Re

Re: Getting better results from valgrind leak tracking

2021-03-16 Thread Tom Lane
Andres Freund writes: > On 2021-03-16 19:36:10 -0400, Tom Lane wrote: >> It doesn't appear to me that we leak much at all, at least not if you >> are willing to take "still reachable" blocks as not-leaked. > Well, I think for any sort of automated testing - which I think would be > useful - we'd

Re: fdatasync performance problem with large number of DB files

2021-03-16 Thread Thomas Munro
On Tue, Mar 16, 2021 at 9:10 PM Fujii Masao wrote: > Thanks for the patch! > > +When set to fsync, which is the default, > +PostgreSQL will recursively open and fsync > +all files in the data directory before crash recovery begins. > > Isn't this a bit misleading? This may

Re: pg_subscription - substream column?

2021-03-16 Thread Amit Kapila
On Wed, Mar 17, 2021 at 4:56 AM Peter Smith wrote: > > On Wed, Mar 17, 2021 at 12:45 AM Amit Kapila wrote: > > > > > > Attached, please find the patch to update the description of substream > > in pg_subscription. > > > > I applied your patch and regenerated the PG docs to check the result. > > L

Re: subscriptionCheck failures

2021-03-16 Thread Amit Kapila
On Tue, Mar 16, 2021 at 6:22 PM osumi.takami...@fujitsu.com wrote: > > > To me, this correctly works because > the timing I put the while loop and stops the walsender > makes the DROP SUBSCRIPTION affects two slots. Any comments ? > No, your testing looks fine. I have also done the similar test.

Re: [HACKERS] logical decoding of two-phase transactions

2021-03-16 Thread Amit Kapila
On Wed, Mar 17, 2021 at 8:07 AM vignesh C wrote: > > On Tue, Mar 16, 2021 at 7:22 PM Amit Kapila wrote: > > > > On Tue, Mar 16, 2021 at 6:22 PM vignesh C wrote: > > > > > > On Mon, Mar 15, 2021 at 6:14 PM Ajin Cherian wrote: > > > > > > > > On Mon, Mar 15, 2021 at 2:04 PM Amit Kapila > > > >

Re: fdatasync performance problem with large number of DB files

2021-03-16 Thread Thomas Munro
On Tue, Mar 16, 2021 at 9:29 PM Fujii Masao wrote: > On 2021/03/16 8:15, Thomas Munro wrote: > > I don't want to add a hypothetical sync_after_crash=none, because it > > seems like generally a bad idea. We already have a > > running-with-scissors mode you could use for that: fsync=off. > > I hear

Re: Getting better results from valgrind leak tracking

2021-03-16 Thread Andres Freund
Hi, On Tue, Mar 16, 2021, at 20:01, Tom Lane wrote: > Andres Freund writes: > > On 2021-03-16 19:36:10 -0400, Tom Lane wrote: > >> It doesn't appear to me that we leak much at all, at least not if you > >> are willing to take "still reachable" blocks as not-leaked. > > > Well, I think for any so

Re: pl/pgsql feature request: shorthand for argument and local variable references

2021-03-16 Thread Michael Paquier
On Mon, Mar 15, 2021 at 05:31:18AM +0100, Pavel Stehule wrote: > Thank you very much I am not much a fan of the implementation done here. Based on my understanding of the PL code, the namespace lookup is organized as a list of items, with the namespace associated to the routine name being the fir

Re: Getting better results from valgrind leak tracking

2021-03-16 Thread Tom Lane
"Andres Freund" writes: > On Tue, Mar 16, 2021, at 20:01, Tom Lane wrote: >> That seems both unnecessary and impractical. We have to consider that >> everything-still-reachable is an OK final state. > I don't consider "still reachable" a leak. Just definitely unreachable. OK, we're in violent a

Re: Regression tests vs SERIALIZABLE

2021-03-16 Thread Thomas Munro
On Tue, Mar 16, 2021 at 3:28 AM Tom Lane wrote: > Thomas Munro writes: > > On Mon, Mar 15, 2021 at 5:24 PM Thomas Munro wrote: > >> However, since commit 862ef372d6b, there *is* one test that fails if > >> you run make installcheck against a cluster running with -c > >> default_transaction_isola

Re: pl/pgsql feature request: shorthand for argument and local variable references

2021-03-16 Thread Pavel Stehule
st 17. 3. 2021 v 4:52 odesílatel Michael Paquier napsal: > On Mon, Mar 15, 2021 at 05:31:18AM +0100, Pavel Stehule wrote: > > Thank you very much > > I am not much a fan of the implementation done here. Based on my > understanding of the PL code, the namespace lookup is organized as a > list of

Re: Regression tests vs SERIALIZABLE

2021-03-16 Thread Tom Lane
Thomas Munro writes: > On Tue, Mar 16, 2021 at 3:28 AM Tom Lane wrote: >> Usually, if we issue a SET in the regression tests, we explicitly RESET >> as soon thereafter as practical, so as to have a well-defined scope >> where the script is running under unusual conditions. > Oh, of course. Than

Re: Assertion failure with barriers in parallel hash join

2021-03-16 Thread Thomas Munro
On Sat, Mar 6, 2021 at 9:56 AM Thomas Munro wrote: > While working on Melanie's Parallel Hash Full Join patch I remembered > that this (apparently extremely rare) race still needs fixing. Here > is a slightly tidied version, which I'm adding to the next CF for CI > coverage. Pushed and back-patc

Re: libpq debug log

2021-03-16 Thread Kyotaro Horiguchi
At Wed, 17 Mar 2021 02:09:32 +, "tsunakawa.ta...@fujitsu.com" wrote in > Alvaro-san, > > > Thank you for taking your time to take a look at an incomplete patch. I > thought I would ask you for final check for commit after Iwata-san has > reflected my review comments. > > I discussed wi

Re: PATCH: Attempt to make dbsize a bit more consistent

2021-03-16 Thread Michael Paquier
On Mon, Mar 15, 2021 at 03:10:59PM +0900, Michael Paquier wrote: > Anyway, as mentioned by other people upthread, I am not really > convinced either that we should have more flavors of size functions, > particularly depending on the relkind as this would be confusing for > the end-user. pg_relatio

Re: Getting better results from valgrind leak tracking

2021-03-16 Thread Andres Freund
Hi, On 2021-03-16 20:50:17 -0700, Andres Freund wrote: > What I meant was that I didn't understand how there's not a leak > danger when compilation fails halfway through, given that the context > in question is below TopMemoryContext and that I didn't see a relevant > TRY block. But that probably

Re: [HACKERS] logical decoding of two-phase transactions

2021-03-16 Thread Amit Kapila
On Tue, Mar 16, 2021 at 5:03 PM Amit Kapila wrote: > > On Mon, Mar 15, 2021 at 6:14 PM Ajin Cherian wrote: > > > > Here's a new patch-set that implements this new solution proposed by Amit. > > Patchset-v60 implements: > > > > I have reviewed the latest patch and below are my comments, some of >

Re: Assertion failure with barriers in parallel hash join

2021-03-16 Thread Thomas Munro
On Wed, Mar 17, 2021 at 6:17 PM Thomas Munro wrote: > On Sat, Mar 6, 2021 at 9:56 AM Thomas Munro wrote: > > While working on Melanie's Parallel Hash Full Join patch I remembered > > that this (apparently extremely rare) race still needs fixing. Here > > is a slightly tidied version, which I'm a

Re: pl/pgsql feature request: shorthand for argument and local variable references

2021-03-16 Thread Julien Rouhaud
On Wed, Mar 17, 2021 at 05:30:30AM +0100, Pavel Stehule wrote: > st 17. 3. 2021 v 4:52 odesílatel Michael Paquier > > > I am wondering whether it would be better to allow multiple aliases > > though, and if it would bring more readability to the routines written > > if these are treated equal to

Re: Type of wait events WalReceiverWaitStart and WalSenderWaitForWAL

2021-03-16 Thread Kyotaro Horiguchi
At Tue, 16 Mar 2021 15:42:27 +0900, Fujii Masao wrote in > > > On 2021/03/16 11:59, Kyotaro Horiguchi wrote: > > At Tue, 16 Mar 2021 03:12:54 +0900, Fujii Masao > > wrote in > >> The wait event WalReceiverWaitStart has been categorized in the type > >> Client. > >> But why? Walreceiver is wai

Re: Type of wait events WalReceiverWaitStart and WalSenderWaitForWAL

2021-03-16 Thread Kyotaro Horiguchi
At Wed, 17 Mar 2021 15:31:37 +0900 (JST), Kyotaro Horiguchi wrote in > WAIT_EVENT_WAL_RECEIVER_MAIN(WalReceiverMain) is waiting for new data > to arrive. This looks like an activity to me. > > WAIT_EVENT_WAL_RECEIVER_WAIT_START is waiting for waiting for starup > process to kick me. So it may

Re: [HACKERS] logical decoding of two-phase transactions

2021-03-16 Thread Peter Smith
On Fri, Mar 12, 2021 at 8:38 PM vignesh C wrote: > ... > 1) I felt twophase_given can be a local variable, it need not be added > as a function parameter as it is not used outside the function. > --- a/src/backend/commands/subscriptioncmds.c > +++ b/src/backend/commands/subscriptioncmds.c > @@ -67

<    1   2