Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> On 2018-Aug-06, Peter Geoghegan wrote:
>> Sure enough, that's what the bug is - a few debugging calls to
>> RelationMapFilenodeToOid() within nbtsort.c proves it.
> Uh, that's weird, isn't it? I mean, why is the relfilenode changing
> underneath?
Because we're building a brand new index in a new file.
> Why isn't it blocked by the CREATE INDEX? Or is CREATE
> INDEX inflicting that upon itself?
The problem is (or so I assume) failure to propagate process-local
state of relmapper.c into the worker processes. So the leader knows
that we've assigned a new relfilenode to some mapped index, but the
workers don't.
regards, tom lane