Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oXvQS-000824-Af for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Sep 2022 02:13:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oXvQP-0003Zj-N5 for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Sep 2022 02:13:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oXvQP-0003Za-8Q for pgsql-hackers@lists.postgresql.org; Tue, 13 Sep 2022 02:13:21 +0000 Received: from mail-il1-x12c.google.com ([2607:f8b0:4864:20::12c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oXvQH-0006u0-LA for pgsql-hackers@lists.postgresql.org; Tue, 13 Sep 2022 02:13:20 +0000 Received: by mail-il1-x12c.google.com with SMTP id k9so5516218ils.12 for ; Mon, 12 Sep 2022 19:13:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date; bh=aNfqNQ65XxBXcliRAEhS4wCqGmOyj288Yc3thGDFKlA=; b=leUcAyXKSAkbgaqKR+rcF8225sigHF+OTkkuJr7Jf6C6hnxbsOdBixRSA4l8ThwHzU DEsLGduilV1ISmqTJIVPaxzwdQuKVk5IuEPLuwQPSNH5hmGjzVkwAH8TWUy0uvHQAhjk qneYpwDi9DANHXK8UEHyZRDOetPKppDGsXTZRE36DeodIH5KQ24SGLfQL3UJmTHrsIyL 5boGuK0mRUumdD56PK42qjZrewaF0D2Va0W2CCjyqH3WI/npk9/Z/QYtnII4IzbBiv7S mFVK1sU7n5+og0hQlSDkYkAGV2QfJsL1j40wl6J7Px7Jeln+ycSraOJWlKekqK7/90fg lWuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date; bh=aNfqNQ65XxBXcliRAEhS4wCqGmOyj288Yc3thGDFKlA=; b=cqpSnChssQr8hTiPbxXyWItz2MS7EJuusSdwch87M9hz5IK+Bg4XlU1Zldo2JaXs88 EygthWaynPn3Y+pGa8LomDzmOTYlhF/I5BqWnmgJzNefWpjyOpVRCaGRdIzPjTkprau3 Bk7Qf0x003Xq0rtFEimBMFeAVrY53+oEHa7XoxuUoSa9iEXu11/zOZTiKnpqdaK/Al7L 1akg/dC9y3NTrbGuBRLmh9OY4kr7YvCNnqvUOsTGAFOEHaOivrSeunPcGW4EwYEgY12X lUlWwGTauqa8yhCdWGkYFGe8YxHtLj/ZK41muaf8+VtdFqWzGdqwyOJRrA8kynlg7HoU Br9g== X-Gm-Message-State: ACgBeo3IEIPzEaDCjhgKl0DiTi4d57aaAXDQtgWvn4KH5F+638Oo3IqW iqLNf/DYnioEg5f0X1GuhzrCmg== X-Google-Smtp-Source: AA6agR7dltgZrPu7Os4I/4XxeNT95N3rc8wYt49wIIQitipS9MAOeypf59p2fp0LpE0xCYYw3Gxy5A== X-Received: by 2002:a92:cac3:0:b0:2e9:4292:ae34 with SMTP id m3-20020a92cac3000000b002e94292ae34mr11370480ilq.285.1663035192793; Mon, 12 Sep 2022 19:13:12 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id f5-20020a056638112500b003495b85a3b9sm4688908jar.178.2022.09.12.19.13.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Sep 2022 19:13:12 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 9D1B3800EB6; Mon, 12 Sep 2022 21:13:11 -0500 (CDT) Date: Mon, 12 Sep 2022 21:13:11 -0500 From: Justin Pryzby To: Thomas Munro Cc: Robert Haas , Aleksander Alekseev , pgsql-hackers@lists.postgresql.org, Michael Paquier Subject: Re: Background writer and checkpointer in crash recovery Message-ID: <20220913021311.GN31833@telsasoft.com> References: <162763450191.31964.15384962987091520173.pgcf@coridan.postgresql.org> <20220912005443.GB31833@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220912005443.GB31833@telsasoft.com> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, Sep 11, 2022 at 07:54:43PM -0500, Justin Pryzby wrote: > On Tue, Aug 03, 2021 at 02:19:22PM +1200, Thomas Munro wrote: > > On Tue, Aug 3, 2021 at 9:52 AM Thomas Munro wrote: > > > On Tue, Aug 3, 2021 at 1:17 AM Robert Haas wrote: > > > > That's great. I just realized that this leaves us with identical > > > > RequestCheckpoint() calls in two nearby places. Is there any reason > > > > not to further simplify as in the attached? > > > > > > LGTM. > > > > And pushed. > > Gripe: this made the "ps" display worse than before. > > 7ff23c6d2 Run checkpointer and bgwriter in crash recovery. > > A couple years ago, I complained that during the end-of-recovery > checkpoint, the "ps" display still said "recovering NNNNN", which made > it look like it was stuck on a particular WAL file. > > That led to commit df9274adf, which updated the startup process's "ps" > to say "end-of-recovery checkpoint". > > But since the start process no longer does the checkpoint, it still > says: > > postgres 19738 11433 5 19:33 ? 00:00:01 postgres: startup recovering 000000010000000C000000FB > postgres 19739 11433 3 19:33 ? 00:00:00 postgres: checkpointer performing end-of-recovery checkpoint > > That looks inconsistent. It'd be better if the startup process's "ps" > were cleared. Like this, maybe. It's similar to what I suggested to consider backpatching here: https://www.postgresql.org/message-id/20201214032224.GA30237%40telsasoft.com diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 7a710e6490d..4bf8614d45f 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -5302,6 +5302,7 @@ StartupXLOG(void) EndOfLogTLI = endOfRecoveryInfo->endOfLogTLI; abortedRecPtr = endOfRecoveryInfo->abortedRecPtr; missingContrecPtr = endOfRecoveryInfo->missingContrecPtr; + set_ps_display(""); /* * When recovering from a backup (we are in recovery, and archive recovery