On Wed, Mar 10, 2021 at 9:07 AM Tom Lane <t...@sss.pgh.pa.us> wrote: > > Amit Kapila <akap...@postgresql.org> writes: > > Enable parallel SELECT for "INSERT INTO ... SELECT ...". > > skink (valgrind) is unhappy: > > creating configuration files ... ok > running bootstrap script ... ok > performing post-bootstrap initialization ... ==4085668== VALGRINDERROR-BEGIN > ==4085668== Conditional jump or move depends on uninitialised value(s) > ==4085668== at 0x4AEB77: max_parallel_hazard_walker (clauses.c:700) > ==4085668== by 0x445287: expression_tree_walker (nodeFuncs.c:2188) > ==4085668== by 0x4AEBB8: max_parallel_hazard_walker (clauses.c:860) > ==4085668== by 0x4B045E: is_parallel_safe (clauses.c:637) > ==4085668== by 0x4985D0: grouping_planner (planner.c:2070) > ==4085668== by 0x49AE4F: subquery_planner (planner.c:1024) > ==4085668== by 0x49B4F5: standard_planner (planner.c:404) > ==4085668== by 0x49BAD2: planner (planner.c:273) > ==4085668== by 0x5818BE: pg_plan_query (postgres.c:809) > ==4085668== by 0x581977: pg_plan_queries (postgres.c:900) > ==4085668== by 0x581E70: exec_simple_query (postgres.c:1092) > ==4085668== by 0x583F7A: PostgresMain (postgres.c:4327) > ==4085668== Uninitialised value was created by a stack allocation > ==4085668== at 0x4B0363: is_parallel_safe (clauses.c:599) > ==4085668== > ==4085668== VALGRINDERROR-END > > There are a few other commits that skink hasn't seen before, but given > the apparent connection to parallel planning, none of the others look > like plausible candidates to explain this. >
Right, the patch forgot to initialize a new variable in max_parallel_hazard_context via is_parallel_safe. I think we need to initialize all the new variables as NULL because is_parallel_safe is used to check parallel-safety of expressions. These new variables are only required for checking parallel-safety of target relation which is already done at the time of initial checks in standard_planner. -- With Regards, Amit Kapila.