Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g9gHI-00009q-UP for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Oct 2018 00:53:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g9gHH-0006s6-8b for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Oct 2018 00:53:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g9gHH-0006re-0z for pgsql-hackers@lists.postgresql.org; Tue, 09 Oct 2018 00:53:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g9gHF-0006IA-0n for pgsql-hackers@postgresql.org; Tue, 09 Oct 2018 00:53:34 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w990rTBN017044; Mon, 8 Oct 2018 20:53:29 -0400 From: Tom Lane To: Thomas Munro cc: Pg Hackers Subject: Re: DSM segment handle generation in background workers In-reply-to: References: Comments: In-reply-to Thomas Munro message dated "Tue, 09 Oct 2018 13:38:54 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <17042.1539046409.1@sss.pgh.pa.us> Date: Mon, 08 Oct 2018 20:53:29 -0400 Message-ID: <17043.1539046409@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thomas Munro writes: > On Mon, Oct 8, 2018 at 1:17 AM Thomas Munro > wrote: >> That's because the bgworker startup path doesn't contain a call to >> srandom(...distinguishing stuff...), unlike BackendRun(). I suppose >> do_start_bgworker() could gain a similar call... or perhaps that call >> should be moved into InitPostmasterChild(). If we put it in there >> right after MyStartTime is assigned a new value, we could use the same >> incantation that PostmasterMain() uses. > Maybe something like this? I think the bit with #ifndef HAVE_STRONG_RANDOM random_seed = 0; random_start_time.tv_usec = 0; #endif should also be done in every postmaster child, no? If we want to hide the postmaster's state from child processes, we ought to hide it from all. regards, tom lane