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 1n0dUa-000441-8x for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Dec 2021 05:51: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 1n0dUX-0007vy-Ra for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Dec 2021 05:51:45 +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 1n0dUX-0007v2-GL for pgsql-hackers@lists.postgresql.org; Fri, 24 Dec 2021 05:51:45 +0000 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1n0dUQ-0001I9-KF for pgsql-hackers@lists.postgresql.org; Fri, 24 Dec 2021 05:51:44 +0000 Received: by mail-pf1-x42c.google.com with SMTP id 8so7015925pfo.4 for ; Thu, 23 Dec 2021 21:51:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:message-id:to:cc:subject:from:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=QZLtjWVwBofF6aHagvq7e/Dp8maGrD90DozfsZLNCx0=; b=b54lQxQ/JYqnCwTGwxM16hx3k/CttZUSZndJW6X8ebrWLoDZaPRJVKfkq+Ok5UxFDk pX8kpE+nbEc+784tUPN6GcdcpsCPSw8ZBo3urA3dWllwGb/FpMeG+6zwDxY3+/BkBCHm +ayBSfEV6TQz6Q+ssl3nkpzG6ekFpADX4L2CxKfWPweEY67c7WlrbQPlrynAtJAkkO1n cJ6mKEnFOlkxz/XP49vQqA9JdCWlsUUr5kzCGhZofoDcoAD3ui9UXiZ59X8GgHYl/kPW EYj70UIrp8/4xajhbA488TFY4CUUJD1FkY+jc8Rc/9tefOIjnVL8YVjB6Gz1zU0AcXw9 lZqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:to:cc:subject:from:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=QZLtjWVwBofF6aHagvq7e/Dp8maGrD90DozfsZLNCx0=; b=mSESNJpldhUf2wJqa9gr3XRiEmLbeJWRV6kO9YKDZ/DWsckD0bXD4eQibBGtzfaN75 G44HSGpmcgb3CYASG2V5dK7W/KK/ZXD3LA3yHvGAKrBEeljYoEnRlDAfOpa3ufvoj5Ns 11Cg41sq4x2TUFiC6Ygb/OBomSdbb/tcFdYzJKln4WKZzBTcR+2TErKX5dwVymBYq7yQ 8c7sOyzMAZs5qScsy/VDiiCn6IAek80EM62N99Z+5ItzAhiPpZ8bY/wAwvdlDXh6CNRG oJ3l8dmf5a6LqJnhAB5vKGKFDszMshHfah9Aqv9mVv9LRQCERMWCGTO/Ck9VKrBz3M+e d9xw== X-Gm-Message-State: AOAM531iAYTT7PAEtXG6giQM40LGIeRqr8tCbA5BQ/Hw0zjC2490DdUL zqpaZoDuCygb/+UCkc4LIu1j4SVzzOo= X-Google-Smtp-Source: ABdhPJxXBKyrABntgj0OtQtbkpoSu1G5yUAtMFeZfA2tJiT+kqDQR5y3zKPuRaRvVbbyouN4MB0Kpg== X-Received: by 2002:a62:8f87:0:b0:4ba:a2f0:5f88 with SMTP id n129-20020a628f87000000b004baa2f05f88mr5565634pfd.80.1640325097470; Thu, 23 Dec 2021 21:51:37 -0800 (PST) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id ip5sm7353049pjb.1.2021.12.23.21.51.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Dec 2021 21:51:36 -0800 (PST) Date: Fri, 24 Dec 2021 14:51:34 +0900 (JST) Message-Id: <20211224.145134.1164706994861031206.horikyota.ntt@gmail.com> To: bharath.rupireddyforpostgres@gmail.com Cc: pgsql-hackers@lists.postgresql.org Subject: Re: Add checkpoint and redo LSN to LogCheckpointEnd log message From: Kyotaro Horiguchi In-Reply-To: References: User-Agent: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk At Thu, 23 Dec 2021 20:35:54 +0530, Bharath Rupireddy wrote in > Hi, > > It is useful (for debugging purposes) if the checkpoint end message > has the checkpoint LSN and REDO LSN [1]. It gives more context while > analyzing checkpoint-related issues. The pg_controldata gives the last > checkpoint LSN and REDO LSN, but having this info alongside the log > message helps analyze issues that happened previously, connect the > dots and identify the root cause. > > Attaching a small patch herewith. Thoughts? A big +1 from me. I thought about proposing the same in the past. > [1] > 2021-12-23 14:58:54.694 UTC [1965649] LOG: checkpoint starting: > shutdown immediate > 2021-12-23 14:58:54.714 UTC [1965649] LOG: checkpoint complete: wrote > 0 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; > write=0.001 s, sync=0.001 s, total=0.025 s; sync files=0, > longest=0.000 s, average=0.000 s; distance=0 kB, estimate=0 kB; > LSN=0/14D0AD0, REDO LSN=0/14D0AD0 I thougt about something like the following, but your proposal may be clearer. > WAL range=[0/14D0340, 0/14D0AD0] regards. -- Kyotaro Horiguchi NTT Open Source Software Center