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 1fsUNM-0003Kt-NX for pgsql-bugs@arkaria.postgresql.org; Wed, 22 Aug 2018 14:44:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fsUNK-0004BO-Aq for pgsql-bugs@arkaria.postgresql.org; Wed, 22 Aug 2018 14:44:46 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fsUNK-0004BF-0u for pgsql-bugs@lists.postgresql.org; Wed, 22 Aug 2018 14:44:46 +0000 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fsUNH-00035a-9N for pgsql-bugs@lists.postgresql.org; Wed, 22 Aug 2018 14:44:44 +0000 Received: by mail-qt0-x241.google.com with SMTP id f18-v6so2306421qtp.10 for ; Wed, 22 Aug 2018 07:44:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=dYSmrebjhQHxrFIxOQb5+WeNyHmCTPaLl4wF1Q5YIqw=; b=QJYgE1WAFO/BXpE1t/ZmjFGUUz7UKolaKVI4LCsP4kZBFsZ8qzRsJUiGzTw3Nm2lHC RQ55+pc9nzZ7okai9wk00MD0xbUCTeVZPC++uVNgHv8TcMoi7zGS7kqIn5g6U4XWbCQn XC3ZvZarI7u7IvUtjFdH2LvwrTsD3TQyaFd4pyNhEYssIzyCoWA0GySWrbwcZLdtZCtp S5xYupHIkh2H7WngVzXPAIPd5yym+SdxZSLirURswucApZ+BByZrU7/BQbBwe8z5q9Rz CZrXSwdudzQ9afIrc6m3m6HbrL7HfgNyY/cR39L+deh9bNwOw6rfag2U2veD5Klije/k M6ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=dYSmrebjhQHxrFIxOQb5+WeNyHmCTPaLl4wF1Q5YIqw=; b=f3zhvgG9pJkJRaI2l57ugs8T830KrhTcvIySPDCCZz0FJxJcKTGJmJFDSAqiDzxe2s E9lSbkXVGG5/FwCaAKl20AaMhnIAeiq21Fiy+F7mlXK6e7xmsx3EHiytaqNhpgnI3CeF 8dmNeYFp2yaCs4SNcI75ANh1O4zOdr59tV/+y4WEkF3fgCRCkwzGe/dtSDBhXxJP2nJW H3N74dkpMnI4aBUtIGKcDf2YExuRP6ZvlfgqGtfmwUBqriuifH2/K+qDEKJQEtXrhPeb wm+nKooS8Vo8OpKSCWqnSoJ2Dy8lKgCnI+7vLZiJzRDBAEadkHLHP6mcGol4i9JYTXw6 vYeg== X-Gm-Message-State: AOUpUlHL+AFnH/tvwhQU7cpZVErlDmmh3AbRVh9Y3rPOEUFGRe5yt+E0 l4/WQtXDARjsDZDW3+kkdPYbFw== X-Google-Smtp-Source: AA+uWPyj1Iqkg3OtjAVArHhXuwte0K5aRnPvCbW1FwU7uIcBXl11rBKbB1nonkFJhSRdhGNU9dyj2g== X-Received: by 2002:ac8:24d0:: with SMTP id t16-v6mr55813324qtt.116.1534949082664; Wed, 22 Aug 2018 07:44:42 -0700 (PDT) Received: from alvin.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id 51-v6sm1209948qtr.91.2018.08.22.07.44.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 Aug 2018 07:44:42 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 11E186FB; Wed, 22 Aug 2018 11:44:40 -0300 (-03) Date: Wed, 22 Aug 2018 11:44:40 -0300 From: Alvaro Herrera To: Alexander Kukushkin Cc: Michael Paquier , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15346: Replica fails to start after the crash Message-ID: <20180822144440.vwup4be6l5xuvpk2@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170306-137-4415bd-dirty (1.8.0) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018-Aug-22, Alexander Kukushkin wrote: > If I comment out the 'BackgroundWorkerInitializeConnection("postgres", > NULL);' call, postgres starts without any problem. > What is very strange, because background worker itself is not doing anything... > > And one more thing, if I add sleep(15) before calling > BackgroundWorkerInitializeConnection, postgres manages to start > successfully. > Is there a very strange race condition here? Sounds likely. I suggest to have a look at what's going on inside the postmaster process when it gets stuck. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services