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.92) (envelope-from ) id 1jBNH7-0004yO-F9 for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Mar 2020 18:37:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jBNH6-00029j-80 for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Mar 2020 18:37:12 +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 1jBNH5-000272-Ro for pgsql-hackers@lists.postgresql.org; Mon, 09 Mar 2020 18:37:12 +0000 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jBNH3-0006z1-Lu for pgsql-hackers@postgresql.org; Mon, 09 Mar 2020 18:37:10 +0000 Received: by mail-qk1-x744.google.com with SMTP id b5so10258621qkh.8 for ; Mon, 09 Mar 2020 11:37:09 -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=Na3BbE9867f/C+/i/6uyWEj3a4TmiCh1A6pRgYLgwHU=; b=O/wDjsY6rWQzWkwpAnX0Ov5LrUWmJ7X8wboUH2mZt5iHdMxsRVJWWe9ggcSEJE1V13 VqnWuxpL6zPLJT7o8CFuNRZYY9Lbm4TSX2eF9y16rzH8dT1cBEp+0K4oDRc1cATkuj3P SpUM/pfyvHEhRXyok60hewRh2+dlyRdTx0Hxe2gCgj77nENRUaJJ4uZfYF4wGDxKwxaQ ojPcnY7qg35Mw3NVV9T8jU3wwB1dfYrndTuf7NLldVyTj0wPprISqDaFETSDOTMwMIxW hSx4JDn0tnVdMUeMBjYe0CUMnsEE3KqI4MKBp6OHcdxQIB9VBL6kCaO5Dwov9plz7r+v d+vA== 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=Na3BbE9867f/C+/i/6uyWEj3a4TmiCh1A6pRgYLgwHU=; b=MydBOtI0kOM3HKkBsldQSBG4hwmlVbimDLlK+980ZRxWQj3ot5bvoRHn/jbc0vfWTb N9xR+apQg7t8wuTq+Ia0kDUyA0ioOT8LxQ6S73I2AZcwlNfyoKdKwIbAY7kcZPhiGqL9 0I1NXoX3Uu79e9Yp1J92qVCC9kVXW5RbCNm7PEZVOSmXKfQ3dP16rwEh6W0KAiQliIMJ IcoETr8ySYHIyVFZrljDFcNbqwpNzQXsv82zxmCoeuxuNf2GycoetGhSs4n+tp3J+/Zf pxte9C4VUzPTPj2/0HSM/RdtFmGT06ZW2kf5SfvNPun80xNvi2tWhOMM1pQ0tzcUXMEN qBNQ== X-Gm-Message-State: ANhLgQ3vgwAdkv3S8Lpp/ZA126BLaJxN2CbS2gkbfeJvoGhecvM6civ/ YwLRN4pm7i3FkQhAVxnAq/fS0Q== X-Google-Smtp-Source: ADFU+vtcVAffpWI8Oi/qBG0rRldyA6NIwaZ823E66oNB/C/KibVCJDkc8SG8z/HNAVPKShO2YT6AKg== X-Received: by 2002:a37:2dc5:: with SMTP id t188mr16762421qkh.249.1583779028593; Mon, 09 Mar 2020 11:37:08 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.121.31.1]) by smtp.gmail.com with ESMTPSA id j4sm2462959qtn.78.2020.03.09.11.37.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2020 11:37:07 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 56F3A3008DB; Mon, 9 Mar 2020 15:37:05 -0300 (-03) Date: Mon, 9 Mar 2020 15:37:05 -0300 From: Alvaro Herrera To: Tom Lane Cc: Kyotaro Horiguchi , michael@paquier.xyz, thomas.munro@gmail.com, tomas.vondra@2ndquadrant.com, andres@anarazel.de, a.zakirov@postgrespro.ru, ah@cybertec.at, magnus@hagander.net, robertmhaas@gmail.com, pgsql-hackers@postgresql.org Subject: Re: shared-memory based stats collector Message-ID: <20200309183705.GA10363@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <15888.1583770875@sss.pgh.pa.us> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Tom Lane escribió: In patch 0003, > /* > - * Was it the archiver? If so, just try to start a new one; no need > - * to force reset of the rest of the system. (If fail, we'll try > - * again in future cycles of the main loop.). Unless we were waiting > - * for it to shut down; don't restart it in that case, and > - * PostmasterStateMachine() will advance to the next shutdown step. > + * Was it the archiver? Normal exit can be ignored; we'll start a new > + * one at the next iteration of the postmaster's main loop, if > + * necessary. Any other exit condition is treated as a crash. > */ > if (pid == PgArchPID) > { > PgArchPID = 0; > if (!EXIT_STATUS_0(exitstatus)) > - LogChildExit(LOG, _("archiver process"), > - pid, exitstatus); > - if (PgArchStartupAllowed()) > - PgArchPID = pgarch_start(); > + HandleChildCrash(pid, exitstatus, > + _("archiver process")); > continue; > } I'm worried that we're causing all processes to terminate when an archiver dies in some ugly way; but in the current coding, it's pretty harmless and we'd just start a new one. I think this needs to be reconsidered. As far as I know, pgarchiver remains unconnected to shared memory so a crash-restart cycle is not necessary. We should continue to just log the error message and move on. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services