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 1knZdP-0007Ev-Oz for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Dec 2020 04:02:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1knZdN-000111-FQ for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Dec 2020 04:02:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1knZdN-00010t-4N for pgsql-hackers@lists.postgresql.org; Fri, 11 Dec 2020 04:02:21 +0000 Received: from mail-io1-xd32.google.com ([2607:f8b0:4864:20::d32]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1knZdG-0002PA-W9 for pgsql-hackers@postgresql.org; Fri, 11 Dec 2020 04:02:20 +0000 Received: by mail-io1-xd32.google.com with SMTP id r9so8088017ioo.7 for ; Thu, 10 Dec 2020 20:02:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=GY0z2nhRAfyMp9wB7GVC+mLG14rZupczIiBYaPg2ri4=; b=dOH+DmjlSko87hjJd0iuJi1q2rUSyeHJz8SHU+RFXukgVbs7NErvbjojGOVySDPMTl q9FbVwdcJ0Q+Mo2Mlg5fwokZGQ++qWuZio2gqWWFd7BEHSmQ2KXtcAxpAFZ5sgFw1hoZ oQ4SJrY1oDnVpyqu/PG0tcMTG6qdjYH1BUgCIFwJpvAQ+T84pBgrarME2HqAlx9U9ueW RKYk8MnsK5osdCYbxvS6YXteIl/riDj3E/09ZO+2nZn2bWRFyEj3w/TRK7uWBzDYam9x CuW2X4sXRJKUV1ICsWZuoB23ho8AtcMpdV5VO531vAJsBxc5DbtyeFQYi4LmLNHoI5s6 cmHw== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=GY0z2nhRAfyMp9wB7GVC+mLG14rZupczIiBYaPg2ri4=; b=MaNnO5Uvj2S8u1CejAlZ09pGIhFRAr9VUPqTR1qt1h4p6InR801mQIDi2URlk82u0v kygui4xSDQtzEroflEFYYQ5Oz21Mbx5CNN2zBAZt+mK6yFMwK3DhisrT+MJqyMrbwcEB 3CpgHRAYhN7TVII+4uJVasknR4ojyg69oGNHB9BoJrxdz4agZWfpLC6rljVRfn88yISY 7G+fjhEI/61WFLANq4ZiLAM1rTv3S3r5D1QiqfwowAxJf8CHn6EaNK+IA8KZBRMWBFsD 3xIm7xELsycyz28Hr8CYapgMKno1I/btIoLz/hmN0LPcwGOsyJhZI/NRm2f4j6CmvkzP n7xQ== X-Gm-Message-State: AOAM533wTS2lQ9nfL19JNKMjzij0H9DohPZVN07NsEVSmO3+/CboqL61 Hri94wssqykVgNJM7QsqJOznEw== X-Google-Smtp-Source: ABdhPJwGbkBuyKAt1MCqZQPAtQqZ+QvrxOPBvaRC6KrtH/6JvajNKKbQydnHk8Pwux+VJ2GepK8s3w== X-Received: by 2002:a6b:3f54:: with SMTP id m81mr12336817ioa.113.1607659332748; Thu, 10 Dec 2020 20:02:12 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id d5sm3594901ios.25.2020.12.10.20.02.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Dec 2020 20:02:11 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id E324D80077C; Thu, 10 Dec 2020 22:02:10 -0600 (CST) Date: Thu, 10 Dec 2020 22:02:10 -0600 From: Justin Pryzby To: Michael Paquier Cc: "Bossart, Nathan" , Fujii Masao , "k.jamison@fujitsu.com" , Thomas Munro , "pgsql-hackers@postgresql.org" Subject: Re: please update ps display for recovery checkpoint Message-ID: <20201211040210.GZ24052@telsasoft.com> References: <20200919160031.GC30557@telsasoft.com> <20201002072814.GE1464@paquier.xyz> <20201002091354.GH8476@telsasoft.com> <9A1B9D98-4576-438A-943F-0AFB05946C7C@amazon.com> <20201203215809.GS24052@telsasoft.com> <1A9049D3-44B9-4504-AC18-4BE42F69E8AB@amazon.com> <549f04f1-6362-b599-c5e6-87330e36f03d@oss.nttdata.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 Isn't the sense of "reset" inverted ? I think maybe you mean to do set_ps_display(""); in the "if reset". On Fri, Dec 11, 2020 at 12:54:22PM +0900, Michael Paquier wrote: > +update_checkpoint_display(int flags, bool restartpoint, bool reset) > +{ > + if (reset) > + { > + char activitymsg[128]; > + > + snprintf(activitymsg, sizeof(activitymsg), "performing %s%s%s", > + (flags & CHECKPOINT_END_OF_RECOVERY) ? "end-of-recovery " : "", > + (flags & CHECKPOINT_IS_SHUTDOWN) ? "shutdown " : "", > + restartpoint ? "restartpoint" : "checkpoint"); > + set_ps_display(activitymsg); > + } > + else > + set_ps_display(""); > +} > + > + > /* > * Perform a checkpoint --- either during shutdown, or on-the-fly > * > @@ -8905,6 +8937,9 @@ CreateCheckPoint(int flags) > if (log_checkpoints) > LogCheckpointStart(flags, false); > > + /* Update the process title */ > + update_checkpoint_display(flags, false, false); > + > TRACE_POSTGRESQL_CHECKPOINT_START(flags); > > /* > @@ -9120,6 +9155,9 @@ CreateCheckPoint(int flags) > /* Real work is done, but log and update stats before releasing lock. */ > LogCheckpointEnd(false); > > + /* Reset the process title */ > + update_checkpoint_display(flags, false, true); > + > TRACE_POSTGRESQL_CHECKPOINT_DONE(CheckpointStats.ckpt_bufs_written, > NBuffers, > CheckpointStats.ckpt_segs_added, > @@ -9374,6 +9412,9 @@ CreateRestartPoint(int flags) > if (log_checkpoints) > LogCheckpointStart(flags, true); > > + /* Update the process title */ > + update_checkpoint_display(flags, true, false); > + > CheckPointGuts(lastCheckPoint.redo, flags); > > /* > @@ -9492,6 +9533,9 @@ CreateRestartPoint(int flags) > /* Real work is done, but log and update before releasing lock. */ > LogCheckpointEnd(true); > > + /* Reset the process title */ > + update_checkpoint_display(flags, true, true); > + > xtime = GetLatestXTime(); > ereport((log_checkpoints ? LOG : DEBUG2), > (errmsg("recovery restart point at %X/%X",