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 1nOZaF-0002ro-Lo for pgsql-hackers@arkaria.postgresql.org; Mon, 28 Feb 2022 06:32:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nOZaD-0006tG-Jd for pgsql-hackers@arkaria.postgresql.org; Mon, 28 Feb 2022 06:32:33 +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 1nOZaD-0006t7-7g for pgsql-hackers@lists.postgresql.org; Mon, 28 Feb 2022 06:32:33 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nOZaA-00084G-GT for pgsql-hackers@lists.postgresql.org; Mon, 28 Feb 2022 06:32:31 +0000 Received: by mail-pj1-x1033.google.com with SMTP id ge19-20020a17090b0e1300b001bcca16e2e7so9489629pjb.3 for ; Sun, 27 Feb 2022 22:32:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=LUIBhOTC8FovpTZoXRaSCeB000qixkGncjzvOJ1j5Go=; b=Lu+gTx112nbvrqx0qmpHXDQDYd+w2cUm+GOpxWfcs7nmDlY/Bo7O8qfaz7i6eIVC5u z872dRX2auR7V8j17Mssd/l3rs129DpCK3vXVzgQ4R/nxt95FxC5vd4qKrKXo/+SCTTc VKSHPAF7P9l5sndhVkO5dvYpDOSPYe4WvWqF0V3Thol8Lh40BP9X+gOFGA8Qd0M+WkSo LuhJbQ21lMWwzlRDPdocWHP+s3DWwBElOF4nHYNtvULnLac5Cl716e69FJ2XwoXqgURn 5GaM0psCN+Zphd1spTjYJtaj/FHHZVHFwjM/HkvhduzvUPfJM2aDZi5fPFD5A7Y++7H4 0ZAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=LUIBhOTC8FovpTZoXRaSCeB000qixkGncjzvOJ1j5Go=; b=E5qAN2/szJ5G/MmX5sWERxgFiNr4ihqy79QV19jCoPr2R9VEtSK5F3k4/g7tM/eVJi Mnp1Y+iFbZHijdq/VDVu85N96UF/Ial9yDnubGpZ4Qysy/uNlcbQ+0aoNnGQcCJDU3gP kB9wuaoZ7v+DX4Kd4muxXan/GnhmRrmOg7is+w28EChUkNoAMYxkYp6onoHtV1YQacPi 1b2wYog5rRS2983HRQxsozz2ro1nZ0M2wxlXE0U8lS2ClHsSnqhuGrdhNdlkDwUJuQK8 O5VvZRtjOLg6yl6Fn0uDHNAi5OAaY008ziACGOfL0ce3KXXnqDsuOG+6oEbkfVqlar9O h2nQ== X-Gm-Message-State: AOAM5312H4CKir0KJnJBGXYTWuOlM3dH89nqLiFSJxv0dO+ET2MHnWB2 jYV0OH2qVkNtm8Mo+KfI9wY= X-Google-Smtp-Source: ABdhPJwKwmXEgy1eJqUnpZmoW9XIG3jirixmgYEsr8DjTsalfWsgz8tLPe+EhAWGT5wWdXiqQWJenA== X-Received: by 2002:a17:902:cf02:b0:14d:54cf:9a6a with SMTP id i2-20020a170902cf0200b0014d54cf9a6amr18761536plg.137.1646029949027; Sun, 27 Feb 2022 22:32:29 -0800 (PST) Received: from jrouhaud (2001-b011-1005-1c63-7063-2c4c-07f7-08d0.dynamic-ip6.hinet.net. [2001:b011:1005:1c63:7063:2c4c:7f7:8d0]) by smtp.gmail.com with ESMTPSA id v21-20020a056a00149500b004e15a113300sm12297002pfu.198.2022.02.27.22.32.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Feb 2022 22:32:28 -0800 (PST) Date: Mon, 28 Feb 2022 14:32:22 +0800 From: Julien Rouhaud To: Bharath Rupireddy Cc: Nitin Jadhav , Ashutosh Sharma , Matthias van de Meent , Bruce Momjian , Tom Lane , Magnus Hagander , PostgreSQL Hackers Subject: Re: Report checkpoint progress with pg_stat_progress_checkpoint (was: Report checkpoint progress in server logs) Message-ID: <20220228063222.rhmlwtdloeetibom@jrouhaud> References: <20220218074351.wgfosjt5lql2vjbr@jrouhaud> <20220219053215.r4wqatln5awklecf@jrouhaud> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Mon, Feb 28, 2022 at 10:21:23AM +0530, Bharath Rupireddy wrote: > > Another thought for my review comment: > > 1) Can't we use pg_is_in_recovery to determine if it's a restartpoint > > or checkpoint instead of having a new function > > pg_stat_get_progress_checkpoint_type? > > I don't think using pg_is_in_recovery work here as it is taken after > the checkpoint has started. So, I think the right way here is to send > 1 in CreateCheckPoint and 2 in CreateRestartPoint and use > CASE-WHEN-ELSE-END to show "1": "checkpoint" "2":"restartpoint". I suggested upthread to store the starting timeline instead. This way you can deduce whether it's a restartpoint or a checkpoint, but you can also deduce other information, like what was the starting WAL. > 11) I think it's discussed, are we going to add the pid of the > checkpoint requestor? As mentioned upthread, there can be multiple backends that request a checkpoint, so unless we want to store an array of pid we should store a number of backend that are waiting for a new checkpoint.