• Tom Lane's avatar
    Un-break parallel pg_upgrade. · 5b570d77
    Tom Lane authored
    Commit b3f84012 changed pg_upgrade so that it'd actually drop and
    re-create the template1 and postgres databases in the new cluster.
    That works fine, serially.  With the -j option it's not so fine, because
    other per-database jobs might be launched while the template1 database is
    dropped.  Since they attempt to connect there to start up, kaboom.
    
    This is the cause of the intermittent failures buildfarm member jacana
    has been showing for the last month; evidently it is the only BF member
    configured to run the pg_upgrade test with parallelism enabled.
    
    Fix by processing template1 separately before we get into the parallel
    sub-job launch loop.  (We could alternatively have made the postgres DB
    be the special case, but it seems likely that template1 will contain
    less stuff and so we lose less parallelism with this choice.)
    5b570d77
pg_upgrade.c 20.3 KB