Hmm, I think this should happen before the transaction snapshot is established in the worker; perhaps immediately after calling StartParallelWorkerTransaction(), or anyway not after SetTransactionSnapshot. In fact, since SetTransactionSnapshot receives a 'sourceproc' argument, why not do it exactly there? ISTM that ProcArrayInstallRestoredXmin() is where this should happen.
-- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/