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 1nPOP6-000095-Cs for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Mar 2022 12:48:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nPOP5-0004AQ-AQ for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Mar 2022 12:48:27 +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 1nPOP4-0004AH-Vd for pgsql-hackers@lists.postgresql.org; Wed, 02 Mar 2022 12:48:27 +0000 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nPOP2-0002DK-QY for pgsql-hackers@lists.postgresql.org; Wed, 02 Mar 2022 12:48:26 +0000 Received: by mail-pj1-x102e.google.com with SMTP id 15-20020a17090a098f00b001bef0376d5cso1687152pjo.5 for ; Wed, 02 Mar 2022 04:48:24 -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=fJ9NOUEeE4KIkhewZEWmka0fCCaETF7NFFlJifrxvfs=; b=Q92vQusRVxrLD0eFjU7boFki9hIxsb+QhNO98mLVpFN1BTTvUkb7qFuZiO3gbifU9E 0mbUIZ2A+U6IBHl8/3UrKqktB3QjQPOktV3NyZZL8Sw4zlMzfgEfAVadF3s4RTSJmxTX 5wxWDv2fy485gpmPPb5K54hhrRYeQ+ZVdixAaQjMMYqerzO4AgL3k8w7QTE+piiGTEgQ SxRI5GZmxymm2hHAfWV5kKhT5tYJ5Z28H9ZerCFcSE7av09zPGQWayx2K+TuJEkCnwQi hiI3zQ53qQJCMo9dymeKKX+O0JenFitkGLDMz++lMyc6VLErIGNMOTdeIzQDBuq427mp Uo0w== 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=fJ9NOUEeE4KIkhewZEWmka0fCCaETF7NFFlJifrxvfs=; b=7ezYmuBEo0cfmviORXwQZXiuYUwMfbgmumkN7zFmI/9RSVgPzBE4zkiTLyMr4KGMEm kzdWpF1PvUK/RojhHk88/LdZ81txO+G9Vfgvcx9nUfqwzPWOFF5taaaQBlHWWoncPf0i Di7vNyucamNdM1ijYKK8lpd1xpLLrxygqY/YHGSEkdDY1T5cTT4Fy6YDFryet7gF/ZsC XHgiHJfK/uj0PJLGnpfCnY9xDXy5C+C/1cpwob688F16wu0THUH9J0mlnCsPpSgdJf8U v5mIv8glXn0PDjprpS3z208HNjBhNyzggsUcRsZZAwcmkREYvF2AbIYyCYMNZmM5SIh7 slmA== X-Gm-Message-State: AOAM531AJ26LzY+/bGyGJ4n+M1H0g2N6UZ0Cn+lC+pOZzIDbkFDp3WAQ Ilua05E2UsAk79g0Z/Xyl/M1dupyOMW6TFrOzf8= X-Google-Smtp-Source: ABdhPJz4nouTk0GyzatcHceKtq5IA08x1FAiiw5rkEl7owhdtPONK/8riaS77Xu7e3GHYEEPPhb+kIjdVrfDbeNZvd8= X-Received: by 2002:a17:902:bf4a:b0:151:7d37:2943 with SMTP id u10-20020a170902bf4a00b001517d372943mr9123235pls.131.1646225301866; Wed, 02 Mar 2022 04:48:21 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Bharath Rupireddy Date: Wed, 2 Mar 2022 18:18:10 +0530 Message-ID: Subject: Re: Add CHECKPOINT_REQUESTED flag to the log message in LogCheckpointStart() To: Nitin Jadhav Cc: 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 On Wed, Mar 2, 2022 at 5:41 PM Nitin Jadhav wrote: > > Hi, > > I have noticed that the CHECKPOINT_REQUESTED flag information is not > present in the log message of LogCheckpointStart() function. I would > like to understand if it was missed or left intentionally. The log > message describes all the possible checkpoint flags except > CHECKPOINT_REQUESTED flag. I feel we should support this. Thoughts? I don't think that's useful. Being in LogCheckpointStart (CreateCheckPoint or CreateRestartPoint) itself means that somebody has requested a checkpoint. Having CHECKPOINT_REQUESTED doesn't add any value. I would suggest removing the CHECKPOINT_REQUESTED flag as it's not being used anywhere instead CheckpointerShmem->ckpt_flags is used as an indication of the checkpoint requested in CheckpointerMain [1]. If others don't agree to remove as it doesn't cause any harm, then, I would add something like this for more readability: if ((((volatile CheckpointerShmemStruct *) CheckpointerShmem)->ckpt_flags) & CHECKPOINT_REQUESTED)) { do_checkpoint = true; PendingCheckpointerStats.m_requested_checkpoints++; } [1] /* * Detect a pending checkpoint request by checking whether the flags * word in shared memory is nonzero. We shouldn't need to acquire the * ckpt_lck for this. */ if (((volatile CheckpointerShmemStruct *) CheckpointerShmem)->ckpt_flags) { do_checkpoint = true; PendingCheckpointerStats.m_requested_checkpoints++; } Regards, Bharath Rupireddy.