Re: Logical Replication WIP

From: Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Andres Freund <andres(at)anarazel(dot)de>
Cc: Erik Rijkers <er(at)xs4all(dot)nl>, Steve Singer <steve(at)ssinger(dot)info>, Craig Ringer <craig(at)2ndquadrant(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, pgsql-hackers-owner(at)postgresql(dot)org
Subject: Re: Logical Replication WIP
Date: 2017-01-03 22:23:44
Message-ID: 54ae4475-a648-d029-6ab0-c7c401bb0762@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 03/01/17 20:39, Peter Eisentraut wrote:
> In 0001-Add-PUBLICATION-catalogs-and-DDL-v16.patch.gz,
>
> +static bool
> +is_publishable_class(Oid relid, Form_pg_class reltuple)
> +{
> + return reltuple->relkind == RELKIND_RELATION &&
> + !IsCatalogClass(relid, reltuple) &&
> + reltuple->relpersistence == RELPERSISTENCE_PERMANENT &&
> + /* XXX needed to exclude information_schema tables */
> + relid >= FirstNormalObjectId;
> +}
>
> I don't think the XXX part is necessary, because IsCatalogClass()
> already checks for the same thing. (The whole thing is a bit bogus
> anyway, because you can drop and recreate the information schema at run
> time without restriction.)
>

I got this remark about IsCatalogClass() from Andres offline as well,
but it's not true, it only checks for FirstNormalObjectId for objects in
pg_catalog and toast schemas, not anywhere else.

> +#define MAX_RELCACHE_INVAL_MSGS 100
> + List *relids = GetPublicationRelations(HeapTupleGetOid(tup));
> +
> + /*
> + * We don't want to send too many individual messages, at some point
> + * it's cheaper to just reset whole relcache.
> + *
> + * XXX: the MAX_RELCACHE_INVAL_MSGS was picked arbitrarily, maybe
> + * there is better limit.
> + */
> + if (list_length(relids) < MAX_RELCACHE_INVAL_MSGS)
>
> Do we have more data on this? There are people running with 100000
> tables, and changing a publication with a 1000 tables would blow all
> that away?
>
> Maybe at least it should be set relative to INITRELCACHESIZE (400) to
> tie things together a bit?
>

I am actually thinking this should correspond to MAXNUMMESSAGES (4096)
as that's the limit on buffer size. I didn't find it the first time
around when I was looking for good number.

--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2017-01-03 22:54:01 Re: Cluster wide option to control symbol case folding
Previous Message Alvaro Herrera 2017-01-03 22:21:49 Re: ALTER TABLE .. ALTER COLUMN .. ERROR: attribute .. has wrong type