Re: BUG #15309: ERROR: catalog is missing 1 attribute(s) for relid 760676 when max_parallel_maintenance_workers > 0
Peter Geoghegan <pg@bowt.ie>
From: Peter Geoghegan <pg@bowt.ie>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, deathlock13@gmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>,
Robert Haas <robertmhaas@gmail.com>
Date: 2018-08-10T16:36:53Z
Lists: pgsql-bugs
On Fri, Aug 10, 2018 at 6:45 AM, Amit Kapila <amit.kapila16@gmail.com> wrote:
> I haven't studied the complete problem, but the way you are
> propagating the information to parallel workers looks correct to me.
> Few minor comments:
>
> 1.
> +void
> +RestoreRelationMap(char *startAddress)
> +{
> + SerializedActiveRelMaps *relmaps;
> +
> + if (active_shared_updates.num_mappings != 0 ||
> + active_local_updates.num_mappings != 0 ||
> + pending_shared_updates.num_mappings != 0 ||
> + pending_local_updates.num_mappings != 0)
> + elog(ERROR, "parallel worker has existing mappings");
> ..
>
> Shouldn't above be Assert?
This was based on AtPrepare_RelationMap().
> 2.
> +void
> +SerializeRelationMap(Size maxSize, char *startAddress)
> +{
> + SerializedActiveRelMaps *relmaps;
> +
> + relmaps = (SerializedActiveRelMaps *) startAddress;
> + relmaps->active_shared_updates = active_shared_updates;
> + relmaps->active_local_updates = active_local_updates;
> ..
> }
>
> Some of the other serialize functions use maxSize for Asserts. See
> SerializeComboCIDState. I think we can do without that as well, but
> it makes code consistent.
I'll put an assert in there.
Thanks
--
Peter Geoghegan
Commits
-
Handle parallel index builds on mapped relations.
- 4974d7f87e62 12.0 landed
- 9353d94a9b70 11.0 landed
-
Transfer state pertaining to pending REINDEX operations to workers.
- 29d58fd3adae 11.0 cited