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 1nKkHs-0007De-PB for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Feb 2022 17:09:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nKkHr-0001Wp-DG for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Feb 2022 17:09:47 +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 1nKkHr-0001Wf-2S for pgsql-hackers@lists.postgresql.org; Thu, 17 Feb 2022 17:09:47 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nKkHl-0003Ot-CA for pgsql-hackers@lists.postgresql.org; Thu, 17 Feb 2022 17:09:46 +0000 Received: by mail-ed1-x533.google.com with SMTP id i11so9176701eda.9 for ; Thu, 17 Feb 2022 09:09:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KX81R5OfvFTU9sA7VOkdjCOfXKnZKO+kwix9SXk2tX0=; b=kCJd7+8WNy4gDzsE4+J5pG0tyrpm4IcwhZ9UqLJZIDVokw+pBFyHrqBJeGkr6JuD7a nRm0+OYg3ChepcCqHhLNr5c1DmzJ4hWoI6njEQruocXIPTLKyaeqgO1WCqtDs9D29yIF d98Nrkaqzg45vD+CaKDuiRLuIb3cUNdsvjaNZ5xZZqRIkDOC5Z+RpTZOK2M9DNOAd2z7 v+RvJqQPqP7GfwaOtZBpfIdUNwGPi5BSnXFL5M2KYyMeKYyjXjQeIF5b3af+Iea5aEqB jKBm1jVXKHGWWJfr+Ww5nFkuv1ClfPdSM4d0Kx7nRlsI1BYSg84nfZd5Gl35sRmTOa3u syQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KX81R5OfvFTU9sA7VOkdjCOfXKnZKO+kwix9SXk2tX0=; b=P7ES7464P5LN2qVIpUQnZqhQXJ9kHk1+twzkmHgECmCJCbLF+hCa5hdat9ZZXKUqD0 enEkAhtUsAPXMtu9mwCwULI/VKJdBwqC2qWQnJ0qxTTsrKgozs2h6BUIHMxzHka2eKkZ FZkf95jg5ykMCurQddtpq9HI91ylOAUyXdPN2djSk9lfyo0TV3LDJMquiD7Wr25K9BUZ 4dl1i8W+hlt0JoGmwZyX7HjkIO0CVhhPhjhtsVyzDYAHwfudkAPLWnoiAENrAx0IRg2g HJG3pwovSNqlzKMaTdQ3C/MYTXRwGB/Y8oQGyFSxucb38GH/EYi/xJ+XTlcsqL5Et434 IH+g== X-Gm-Message-State: AOAM532dD/h/r10ht4I5VGFto7Vaq4GkoVcmUYjAlyYjBABrUv0rZLRb +prcl7g1trCG6EeedqFFW6Wy0Go1c0DKX/Vf0bz6Xgt/mBA= X-Google-Smtp-Source: ABdhPJy07zQFlkTWYXWiuhgdaczBo0O+pHSSTQ8HZzxU1gbJx62EoCgdb1Un2TsmjR2MMWiBSzZVEv9Qkdlj16KHhoY= X-Received: by 2002:aa7:c582:0:b0:40a:92b2:1bc4 with SMTP id g2-20020aa7c582000000b0040a92b21bc4mr3731926edq.202.1645117779351; Thu, 17 Feb 2022 09:09:39 -0800 (PST) MIME-Version: 1.0 References: <2031846.1640792459@sss.pgh.pa.us> <20220217110515.zssjnez4lq2lmrdq@jrouhaud> In-Reply-To: <20220217110515.zssjnez4lq2lmrdq@jrouhaud> From: Nitin Jadhav Date: Thu, 17 Feb 2022 22:39:02 +0530 Message-ID: Subject: Re: Report checkpoint progress with pg_stat_progress_checkpoint (was: Report checkpoint progress in server logs) To: Julien Rouhaud Cc: Matthias van de Meent , Bharath Rupireddy , Bruce Momjian , Tom Lane , Magnus Hagander , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > > Thank you for sharing the information. 'triggering backend PID' (int) > > - can be stored without any problem. > > There can be multiple processes triggering a checkpoint, or at least wanting it > to happen or happen faster. Yes. There can be multiple processes but there will be one checkpoint operation at a time. So the backend PID corresponds to the current checkpoint operation. Let me know if I am missing something. > > 'checkpoint or restartpoint?' > > Do you actually need to store that? Can't it be inferred from > pg_is_in_recovery()? AFAIK we cannot use pg_is_in_recovery() to predict whether it is a checkpoint or restartpoint because if the system exits from recovery mode during restartpoint then any query to pg_stat_progress_checkpoint view will return it as a checkpoint which is ideally not correct. Please correct me if I am wrong. Thanks & Regards, Nitin Jadhav On Thu, Feb 17, 2022 at 4:35 PM Julien Rouhaud wrote: > > Hi, > > On Thu, Feb 17, 2022 at 12:26:07PM +0530, Nitin Jadhav wrote: > > > > Thank you for sharing the information. 'triggering backend PID' (int) > > - can be stored without any problem. > > There can be multiple processes triggering a checkpoint, or at least wanting it > to happen or happen faster. > > > 'checkpoint or restartpoint?' > > Do you actually need to store that? Can't it be inferred from > pg_is_in_recovery()?