On Fri, Jan 12, 2018 at 8:19 AM, Amit Kapila <amit.kapil...@gmail.com> wrote: > 1. > + if (!IsBootstrapProcessingMode() && !indexInfo->ii_Concurrent) > { > - snapshot = RegisterSnapshot(GetTransactionSnapshot()); > - OldestXmin = InvalidTransactionId; /* not used */ > + OldestXmin = GetOldestXmin(heapRelation, true); > > I think leader and workers should have the same idea of oldestXmin for > the purpose of deciding the visibility of tuples. I think this is > ensured in all form of parallel query as we do share the snapshot, > however, same doesn't seem to be true for Parallel Index builds.
Hmm. Does it break anything if they use different snapshots? In the case of a query that would be disastrous because then you might get inconsistent results, but if the snapshot is only being used to determine what is and is not dead then I'm not sure it makes much difference ... unless the different snapshots will create confusion of some other sort. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company