This hash table is used to cache the state of streaming transactions being
applied by the parallel apply workers. So, this should be created only
when we are successful in launching at least one worker. This avoids rare
case memory leak when we are never able to launch any worker.
Author: Ted Yu
Discussion: https://postgr.es/m/CALte62wg0rBR3Vj2beV=HiWo2qG9L0hzKcX=yULNER0wmf4aEw@mail.gmail.com
if (!pa_can_start())
return;
+ winfo = pa_launch_parallel_worker();
+ if (!winfo)
+ return;
+
/* First time through, initialize parallel apply worker state hashtable. */
if (!ParallelApplyTxnHash)
{
HASH_ELEM | HASH_BLOBS | HASH_CONTEXT);
}
- winfo = pa_launch_parallel_worker();
- if (!winfo)
- return;
-
/* Create an entry for the requested transaction. */
entry = hash_search(ParallelApplyTxnHash, &xid, HASH_ENTER, &found);
if (found)