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 1nNdZX-0001rJ-Rq for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Feb 2022 16:35:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nNdZW-0003in-OO for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Feb 2022 16:35:58 +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 1nNdZW-0003hv-CL for pgsql-hackers@lists.postgresql.org; Fri, 25 Feb 2022 16:35:58 +0000 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nNdZP-0004Oe-Na for pgsql-hackers@lists.postgresql.org; Fri, 25 Feb 2022 16:35:57 +0000 Received: by mail-pj1-x1035.google.com with SMTP id h17-20020a17090acf1100b001bc68ecce4aso8870688pju.4 for ; Fri, 25 Feb 2022 08:35:51 -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=xpS739BzeahLd6A9ro6m+SIPPhwiRQBti2UfKoRyPpI=; b=ozuhlEcisGsO91DzljHAC9TWveUZ4MvMQbsyfgTrcJdS0tpqHQD3HXSGCjYwoX4UNc IEbqmsWr53jaU2HllR0Y4CKDRc1+HuDuec6PxOF1FAJ0ykQ7v8SWN8byGvV8sIXzAask uEA629F8fLS5ZzUrbYWS+Yb/9BZFDMBP7PQ1wd0v6NYQLAiY/l8y+Rjgwc4pWf+rVEKO 0TEAxA6Mg1nHYKHxpx5E5JGbESohbssVhrLmRrJD6F4Wjz93bBZMnrqBhhH29iWIMjtJ LpdNjCZZPduodyqhhlMEb9FQ7VMqN2YmPIOSqlCzQNsyEJ8Z0Ku70e/oOkU96bfCksbH OUgQ== 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=xpS739BzeahLd6A9ro6m+SIPPhwiRQBti2UfKoRyPpI=; b=ef/IAKq1JQZnOmqCM5ETnBQP2T8ZPngIjjRrrmlmnshJ+yY4tEzNTTkKUM6fpDK7yi UZh+XQz+P9J/aY8rrdCJTO0pM4RaLGiIBletIp2C4bxws1hIwbHpLIvlc8q1INOTwc8Y /xWXprg3BKJTpZTKruzlBDXB/j+noZ3+hgynv/CNhAEVp2ptxSqdjqcpwu0ZSg2BLKOq RoFWSrYn74vWlN2nz2C8HKy6AyCpil9K6xVmzFPPkX4zoVdts1S8fLZi5P8GNMuVzgXN RSg2fdEGXtUAA/w6PhVV+pbnP1IUKbHdQ2dKTZ6j/0RJA1eQbNzgGDSz3tU86kx396J8 q8mg== X-Gm-Message-State: AOAM531itXgklHXvP87naL8epuy4xeBsXSJax1EOH2nqOvUrdCCt1BWC nqV99pvwRJU3nnaGEWYMyK0= X-Google-Smtp-Source: ABdhPJx74GeGv3IYdcAKg1jLBj3UP9Zc/cQ4GCiJBi0dOpp1yYl1ofwC7JQZIP08BN25TyEwZxH4CA== X-Received: by 2002:a17:90a:bd89:b0:1bc:66ed:8aed with SMTP id z9-20020a17090abd8900b001bc66ed8aedmr3982605pjr.96.1645806950632; Fri, 25 Feb 2022 08:35:50 -0800 (PST) Received: from jrouhaud (2001-b011-1005-9344-f455-3efb-d76f-9e4c.dynamic-ip6.hinet.net. [2001:b011:1005:9344:f455:3efb:d76f:9e4c]) by smtp.gmail.com with ESMTPSA id be6-20020a656e46000000b0036c7c63e915sm3010215pgb.48.2022.02.25.08.35.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 08:35:50 -0800 (PST) Date: Sat, 26 Feb 2022 00:35:45 +0800 From: Julien Rouhaud To: Nitin Jadhav Cc: Matthias van de Meent , Bharath Rupireddy , 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: <20220225163545.slsxurx2wbpme7vg@jrouhaud> References: <20220218074351.wgfosjt5lql2vjbr@jrouhaud> <20220219053215.r4wqatln5awklecf@jrouhaud> <20220225070352.fhfwnl5ksfsa4eew@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 On Fri, Feb 25, 2022 at 08:53:50PM +0530, Nitin Jadhav wrote: > > > > I'm not sure what Matthias meant, but as far as I know there's no fundamental > > difference between checkpoint with and without the CHECKPOINT_IMMEDIATE flag, > > and there's also no scheduling for multiple checkpoints. > > > > Yes, the flags will remain the same but checkpoint.c will test both the passed > > flags and the shmem flags to see whether a delay should be added or not, which > > is the only difference in checkpoint processing for this flag. See the call to > > ImmediateCheckpointRequested() which will look at the value in shmem: > > > > /* > > * Perform the usual duties and take a nap, unless we're behind schedule, > > * in which case we just try to catch up as quickly as possible. > > */ > > if (!(flags & CHECKPOINT_IMMEDIATE) && > > !ShutdownRequestPending && > > !ImmediateCheckpointRequested() && > > IsCheckpointOnSchedule(progress)) > > I understand that the checkpointer considers flags as well as the > shmem flags and if CHECKPOINT_IMMEDIATE flag is set, it affects the > current checkpoint operation (No further delay) but does not change > the current flag value. Should we display this change in the kind > field of the view or not? Please share your thoughts. I think the fields should be added. It's good to know that a checkpoint was trigger due to normal activity and should be spreaded, and then something upgraded it to an immediate checkpoint. If you're desperately waiting for the end of a checkpoint for some reason and ask for an immediate checkpoint, you'll certainly be happy to see that the checkpointer is aware of it. But maybe I missed something in the code, so let's wait for Matthias input about it.