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 1n0jMm-0001ml-J0 for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Dec 2021 12:08:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n0jMl-00078Q-Ej for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Dec 2021 12:08:07 +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 1n0jMl-00078G-3t for pgsql-hackers@lists.postgresql.org; Fri, 24 Dec 2021 12:08:07 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1n0jMi-0007R4-Eu for pgsql-hackers@lists.postgresql.org; Fri, 24 Dec 2021 12:08:06 +0000 Received: by mail-pl1-x62c.google.com with SMTP id w7so5996485plp.13 for ; Fri, 24 Dec 2021 04:08:04 -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=QFmlCyAJ+CVHfy2LaKK6myyPNROtwSEMKXtgk/WL+Fo=; b=qGt9u95L9Etr7FZf+Woz8sXDLLU02M2BZtnutuFx8aV1Vq9uHcF5C638lHBR51aA6i 0dj9ASh4IFthqYER6IpCHxYWAN2cQADh4ZA+Jbx2doUAOw8KObNdW3jMF3uxqZ6Qeyjz hMdte2y4R2YNZqxNHoSy8tf6w6vSQgVDs927bAK9fARhSjkaD6Jje4mhxbsOpcDzHo1A C3ezFHAIdjX+JcAVupFyOS6m/saqqB/nWbo3a0grTeGaUnZsZ36QkCkVxDwFuy+j6QJ/ TdSCByeZqH8ZtrnFnIX+hiFqKtW4zSYA+9QjuWXEuZLNNlOMt0HSwwf5MqkZOByoFicH zk4w== 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=QFmlCyAJ+CVHfy2LaKK6myyPNROtwSEMKXtgk/WL+Fo=; b=aeouaPzVqJLYAUTq04Kv9ukj/1x+ByzES/Dg1xTlvSvv+R2/dSBay0sc8sSeAFHGaI 6V2MbQZYhH49/ALCucP9MLK4c6RCODs3s7pyoJ2FuuXhHJ9FR7QGfZV5snll+RzhYoJy fc5wWK040+mF/y9+l2u+OozeFb7pVFbF5kbKlOa1QPb88YRIhwQoDAEKd5gMIvlWZQFo g9Rbid/PTGvMnieaWhakxrVxNGNZ0v/6S4R8yVWD8OyjDmQ9Fed8lrtOGo9eRhpqzkoQ +z9z7Q5DgPF15+LlnuSmsohPodi1mi+YOkPbjTkdrBXScbMcgi+M04bAIU4wLltgYxzM Hknw== X-Gm-Message-State: AOAM530f8GzN6DjEiw/KwJfR2F/m+1Iy+fATBinnaKdrRQHjzj7HNpZg z88/ig/+2Xd6MWsZnSS0ose5+e6DxSE6b8a/ZdE= X-Google-Smtp-Source: ABdhPJwl1iwFZvc1+TOY5SFwYFVmm/sL1SpcWtmDjlxTEW2eLSvYPfrH7e+m93HtJh8O8sKRu4CaG8oNJWe0iDgv48w= X-Received: by 2002:a17:90b:1d07:: with SMTP id on7mr7910571pjb.177.1640347682334; Fri, 24 Dec 2021 04:08:02 -0800 (PST) MIME-Version: 1.0 References: <20211224.145134.1164706994861031206.horikyota.ntt@gmail.com> In-Reply-To: <20211224.145134.1164706994861031206.horikyota.ntt@gmail.com> From: Bharath Rupireddy Date: Fri, 24 Dec 2021 17:37:51 +0530 Message-ID: Subject: Re: Add checkpoint and redo LSN to LogCheckpointEnd log message To: Kyotaro Horiguchi 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 Fri, Dec 24, 2021 at 11:21 AM Kyotaro Horiguchi wrote: > > 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. Thanks for the review. I've added a CF entry to not lose track - https://commitfest.postgresql.org/36/3474/. > > [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] Yeah the proposed in the v1 is clear saying checkpoint/restartpoint LSN and REDO LSN. Regards, Bharath Rupireddy.