Re: row filtering for logical replication

2021-11-27 Thread Peter Smith
On Fri, Nov 26, 2021 at 1:16 PM houzj.f...@fujitsu.com wrote: > ... > Based on this direction, I tried to write a top up POC patch(0005) which I'd > like to share. > > The top up patch mainly did the following things. > > * Move the row filter columns invalidation to CheckCmdReplicaIdentity, so t

Re: enhance pg_log_backend_memory_contexts() to log memory contexts of auxiliary processes

2021-11-27 Thread Bharath Rupireddy
On Sun, Nov 28, 2021 at 12:22 PM vignesh C wrote: > > Attaching v4 patch, please review it further. > > One small comment: > 1) There should be a space in between "LOGmessage level" > +it can) for memory contexts. These memory contexts will be logged at > +LOGmessage level. They wi

Re: Synchronizing slots from primary to standby

2021-11-27 Thread Bharath Rupireddy
On Sun, Oct 31, 2021 at 3:38 PM Peter Eisentraut wrote: > > I want to reactivate $subject. I took Petr Jelinek's patch from [0], > rebased it, added a bit of testing. It basically works, but as > mentioned in [0], there are various issues to work out. > > The idea is that the standby runs a back

Re: enhance pg_log_backend_memory_contexts() to log memory contexts of auxiliary processes

2021-11-27 Thread vignesh C
On Mon, Nov 15, 2021 at 10:27 PM Bharath Rupireddy wrote: > > On Mon, Nov 15, 2021 at 10:04 PM vignesh C wrote: > > > > On Mon, Nov 15, 2021 at 7:47 AM Bharath Rupireddy > > wrote: > > > > > > On Fri, Nov 5, 2021 at 11:12 AM Bharath Rupireddy > > > wrote: > > > > PSA v2 patch and review it. > >

Re: pg_waldump stucks with options --follow or -f and --stats or -z

2021-11-27 Thread Bharath Rupireddy
On Sun, Nov 28, 2021 at 9:50 AM Michael Paquier wrote: > v4 is just moving this paragraph in its correct subsection. My > wording may have been confusing here, sorry about that. What I meant > is that there is no need to mention --follow at all, as an > interruption done before reaching the end

Re: SSL Tests for sslinfo extension

2021-11-27 Thread Michael Paquier
On Sat, Nov 27, 2021 at 02:27:19PM -0500, Tom Lane wrote: > I think testing sslinfo in src/test/ssl is fine, while putting its test > inside contrib/ would be dangerous, because then the test would be run > by default. src/test/ssl is not run by default because the server it > starts is potentiall

Re: Deduplicate code updating ControleFile's DBState.

2021-11-27 Thread Michael Paquier
On Sun, Nov 28, 2021 at 07:53:13AM +0530, Bharath Rupireddy wrote: > Isn't it better if we update the ControlFile->time at the end of the > update_controlfile, after file write/sync? I don't quite understand your point here. We want to update the control file's timestamp when it is written, befor

Re: pg_waldump stucks with options --follow or -f and --stats or -z

2021-11-27 Thread Michael Paquier
On Fri, Nov 26, 2021 at 03:47:30PM +0530, Bharath Rupireddy wrote: > On Fri, Nov 26, 2021 at 11:50 AM Michael Paquier wrote: >> +When --follow is used with --stats and >> +the pg_waldump is terminated or interrupted >> +with signal SIGINT or >> SIGTERM >> +or SIGQUIT, the summary

Re: Unnecessary delay in streaming replication due to replay lag

2021-11-27 Thread Bharath Rupireddy
On Tue, Nov 23, 2021 at 1:39 AM Soumyadeep Chakraborty wrote: > > Hi Bharath, > > Yes, that thread has been discussed here. Asim had x-posted the patch to [1]. > This thread > was more recent when Ashwin and I picked up the patch in Aug 2021, so we > continued here. > The patch has been signific

Re: Deduplicate code updating ControleFile's DBState.

2021-11-27 Thread Bharath Rupireddy
On Fri, Nov 26, 2021 at 2:48 PM Amul Sul wrote: > > ControlFile.state = DB_SHUTDOWNED; > > - ControlFile.time = (pg_time_t) time(NULL); > > This one had better not be removed, either, as we require pg_resetwal > > to guess a set of control file values. Removing the one in > > RewriteControl

Re: Correct handling of blank/commented lines in PSQL interactive-mode history

2021-11-27 Thread Tom Lane
I wrote: > We could perhaps finesse that point by deciding that comment lines > that are handled this way will never be sent to the server --- but > I'm sure people will complain about that, too. I've definitely heard > people complain because "--" comments are stripped from what's sent > (so I'd

Re: rand48 replacement

2021-11-27 Thread Tom Lane
Fabien COELHO writes: >> How did Knuth get into this? This algorithm is certainly not his, >> so why are those constants at all relevant? > They are not more nor less relevant than any other "random" constant. The > state needs a default initialization. The point of using DK's is that it > is

Re: SSL Tests for sslinfo extension

2021-11-27 Thread Tom Lane
Daniel Gustafsson writes: > On 17 Jun 2021, at 09:29, Michael Paquier wrote: >> Hmm. Adding internal dependencies between the tests should be avoided >> if we can. What would it take to move those TAP tests to >> contrib/sslinfo instead? This is while keeping in mind that there was >> a patch

Re: rand48 replacement

2021-11-27 Thread Fabien COELHO
Hello Tom, Thanks for the feedback. +/* use Donald Knuth's LCG constants for default state */ How did Knuth get into this? This algorithm is certainly not his, so why are those constants at all relevant? They are not more nor less relevant than any other "random" constant. The state need

Re: Non-superuser subscription owners

2021-11-27 Thread Mark Dilger
> On Nov 24, 2021, at 4:30 PM, Jeff Davis wrote: > > We need to do permission checking for WITH CHECK OPTION and RLS. The > patch right now allows the subscription to write data that an RLS > policy forbids. Thanks for reviewing and for this observation! I can verify that RLS is not being h

Re: Enforce work_mem per worker

2021-11-27 Thread Justin Pryzby
On Sat, Nov 27, 2021 at 04:33:07PM +, Arne Roland wrote: > Hello! > > Since I used a lot of my time chasing short lived processes eating away big > chunks of memory in recent weeks, I am wondering about a decent way to go > about this. > The problem I am facing essentially relates to the fac

Enforce work_mem per worker

2021-11-27 Thread Arne Roland
Hello! Since I used a lot of my time chasing short lived processes eating away big chunks of memory in recent weeks, I am wondering about a decent way to go about this. The problem I am facing essentially relates to the fact that work_mem settings, while they are enforced per hash and sort node

Re: Windows build warnings

2021-11-27 Thread Andrew Dunstan
On 11/26/21 15:14, Daniel Gustafsson wrote: >> On 26 Nov 2021, at 20:33, Tom Lane wrote: >> >> I think our policy is to suppress unused-variable warnings if they >> appear on current mainstream compilers; and it feels a little churlish >> to deem MSVC non-mainstream. So I stick with my previous

Re: pg_upgrade and publication/subscription problem

2021-11-27 Thread Marcos Pegoraro
> > I think we don't want to make assumptions about the remote end being > the same after the upgrade and we let users reactivate the > subscriptions in a suitable way. See [1] (Start reading from "..When > dumping logical replication subscriptions..") In your case, if you > wouldn't have allowed n

Re: pg_upgrade and publication/subscription problem

2021-11-27 Thread Amit Kapila
On Fri, Nov 26, 2021 at 5:47 PM Marcos Pegoraro wrote: >> >> AFAIU the main problem in your case is that you didn't block the write >> traffic on the publisher side. Let me try to understand the situation. >> After the upgrade is finished, there are some new tables with data on >> the publisher, a

Re: Windows: Wrong error message at connection termination

2021-11-27 Thread Lars Kanis
Am 22.11.21 um 00:04 schrieb Tom Lane: Do we know that that actually happens in an arm's-length connection (ie two separate machines)? I wonder if the data loss is strictly an artifact of a localhost connection. There'd be a lot more pressure on them to make cross-machine TCP work per spec, one

Re: Skipping logical replication transactions on subscriber side

2021-11-27 Thread Amit Kapila
On Fri, Nov 26, 2021 at 7:45 AM tanghy.f...@fujitsu.com wrote: > > On Friday, November 26, 2021 9:30 AM Masahiko Sawada > wrote: > > > > Indeed. Attached an updated patch. Thanks! > > Thanks for your patch. A small comment: > > + OID of the relation that the worker is synchronizing; null f

Re: Skipping logical replication transactions on subscriber side

2021-11-27 Thread Amit Kapila
On Fri, Nov 26, 2021 at 6:00 AM Masahiko Sawada wrote: > > Indeed. Attached an updated patch. Thanks! > I have made a number of changes in the attached patch which includes (a) the patch was trying to register multiple array entries for the same subscription which doesn't seem to be required, see