Note that this patch falsifies the comment in SetNextObjectId that taking the lock is pro forma only -- it no longer is, since in upgrade mode there can be multiple subprocesses running -- so I think it should be updated.
-- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/