Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iDexh-0003KI-FM for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Sep 2019 01:22:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iDexg-0005RR-8E for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Sep 2019 01:22:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iDexf-0005RC-T9 for pgsql-hackers@lists.postgresql.org; Fri, 27 Sep 2019 01:22:20 +0000 Received: from mail-io1-xd41.google.com ([2607:f8b0:4864:20::d41]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iDexd-0007wy-EG for pgsql-hackers@postgresql.org; Fri, 27 Sep 2019 01:22:18 +0000 Received: by mail-io1-xd41.google.com with SMTP id j4so11790085iog.11 for ; Thu, 26 Sep 2019 18:22:17 -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=MquIBHc08eqgK6LCjL7fcrKLm6LfdEMBIkugps0tPSU=; b=bY6rFuvC8SnyBwnY/h7OIxVYPUc2p8Fnmn7iyvx4nZh98zjwQ78qBLASBrTs6kNVSu Y22nW8qREYh+fqvvYDivLM2fHPVXmOkjrzc0xkolBLVSPbO1VSHuDZBdjmaHywTYkqRS UKHeUVFEwvmC87cffzOgRPBJPWwKKKdgPv1OL4Lw73Nk1J/w7UOvxZCr0fEAnC4MnpEX 5sYtd1bm27UK5LXNaqyUaL2klaHB3WqeyuTR7w2IXJy3Qb94gSQjSRA8x+eqttLFx0K/ WjBeXkcfdewx40wBl3y9uax3YBZtD4z/n7UHOuP7wFKnzUPzT8fWb5heugymi4qSTPcS lmLA== 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=MquIBHc08eqgK6LCjL7fcrKLm6LfdEMBIkugps0tPSU=; b=E2p7/yOcpS4mOxNdXowUxi1SSZyrp0Ntm2gsjJbJScXUd6REuJ4tMnKWq1X3Tyqp1T Qo0beAkdMPylZPSWKlfQTZg7WjkkQeeVwE71JjDDxBAELGtZi7bwl9MQy+rgtZTYGVN9 kF9tG1276odOLua7Cx1anb+WErZBNItOVS2YclXWBv4QoKAB+/RzxVEE7IdmWDEuz8Qb jGW+Qa/cv8fBGOEeRo6un4Q58AT92njqy8fD9o1RMO1Zx2o0b7GPCzUjb1LagRdXDuX6 iuEKgRzRcPu1YVw5DAgKJEYDlLYWRnNIxhaSoxrVVDkDsZggXnOMdci3XtaN3BmQwU3O iSoQ== X-Gm-Message-State: APjAAAUTzAFe3zeRlgxH2SKO4qY849o3P3SOjWwdFcvU3INm/PVoRd3y gVCpitUlFZiV1obafiZcXtNO9qrn3I4= X-Google-Smtp-Source: APXvYqxuBfsdSjC0ZOMQhYxCSOnLx0/aD+ggld+G22nurpnBQNlF9CUoU7VHqGgkRPQ4wSHRT01a5A== X-Received: by 2002:a92:8812:: with SMTP id h18mr2009803ild.24.1569547336846; Thu, 26 Sep 2019 18:22:16 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([199.229.249.165]) by smtp.gmail.com with ESMTPSA id y5sm1583484iol.75.2019.09.26.18.22.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 18:22:16 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id F32E412088A; Thu, 26 Sep 2019 22:22:13 -0300 (-03) Date: Thu, 26 Sep 2019 22:22:13 -0300 From: Alvaro Herrera To: Jeff Janes Cc: Craig Ringer , PostgreSQL Hackers Subject: Re: [PATCH] Race condition in logical walsender causes long postgresql shutdown delay Message-ID: <20190927012213.GA10253@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: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Sep-26, Jeff Janes wrote: > On Wed, Sep 11, 2019 at 3:52 PM Alvaro Herrera > wrote: > > > Reading over this code, I noticed that the detection of the catch-up > > state ends up being duplicate code, so I would rework that function as > > in the attached patch. > > > > The naming of those flags (got_SIGUSR2, got_STOPPING) is terrible, but > > I'm not going to change that in a backpatchable bug fix. > > Hi Alvaro, does this count as a review? Well, I'm already a second pair of eyes for Craig's code, so I think it does :-) I would have liked confirmation from Craig that my change looks okay to him too, but maybe we'll have to go without that. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services