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 1oVRWq-0000WH-N0 for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Sep 2022 05:53:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oVRWp-0005Jd-Jl for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Sep 2022 05:53:43 +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 1oVRWp-0005JR-2l for pgsql-hackers@lists.postgresql.org; Tue, 06 Sep 2022 05:53:43 +0000 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oVRWm-00041C-5E for pgsql-hackers@postgresql.org; Tue, 06 Sep 2022 05:53:42 +0000 Received: by mail-pf1-x42f.google.com with SMTP id 65so86531pfx.0 for ; Mon, 05 Sep 2022 22:53:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:from:to:cc:subject :date; bh=R4Cr+knrBpAiU/6OpvCwesT4nwnsk4Ybexn9e+gWk5A=; b=PoSuumyuWJ1brXEiNtyzDwQW3RrdMZr+9Bdg2GmsRTRkBOR54k4adOxz2Z8/kw9d2y GfxQppo20jJra3yfTfJdyP9K0+pNnQkimItKM4XQNSA4QaFVjW4xagZDnP6ZwAO9ydgx 0qOHZyMjeprLZ+l7HDSsRYvqXz53U31s+tH7X6+VtLMWPNoQPux9Cn8LkqAPmwE4wOnP DwelOkVMRWycVGQ7iRWEV3OwWpWIUL3+D19bABqW0R68STVyE8JlTRT01sbKCAGxVw8V VEs9g/agHwHZC2GQXBYPXO6h0KXSx+JMNXE5K0rhmRF6a6lwRsHFsE5IjVkLtsNKqeAa sHYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:x-gm-message-state :from:to:cc:subject:date; bh=R4Cr+knrBpAiU/6OpvCwesT4nwnsk4Ybexn9e+gWk5A=; b=NkRxPJvuc8ocAh2mGWqoVRsSLS3GTnIF7d3HytxAxQayq0h0wLGQU13IC5dyh/6PDp EncxUGLyvW7BPj+6RtQOatzycvN2jNzZEvzyuOpM81xH1ZUnypbZ1j2zNDUmGQsTaOdP zs2bdHv6V37IO3nDvcttByEuzHZkBAQZ7uaVetERLMsg8+oyt4bFbnHBDhkVWxUlmdNI y3HYLvfooLmj2yKQZ9cvr2DcK45L46yo+fokbM18lOGelzxKbf1yKSpAjIM4eSmHBPj8 9yHGGlE9rY5WRSu+KLfyOgqOBzXNEdBx3BPbbRNT9qnodw95zmJriqKU2U6KtADVqMOv /UCQ== X-Gm-Message-State: ACgBeo27qZO8TSOMdhXPFOhM7xDJtcsf1z4TvwmrRtxDAbarKmKSPo/T Xxg+1Bxi25CKORg5LuLoPgs= X-Google-Smtp-Source: AA6agR6WkQYLl6yf3aM/qT/8AfJTElR0fPSDjjaX2YElSJliTfNB2Aux6T2hTUrfDG+1mRZ7hHkTzQ== X-Received: by 2002:a63:5244:0:b0:434:a3b1:bbe8 with SMTP id s4-20020a635244000000b00434a3b1bbe8mr1871338pgl.57.1662443619100; Mon, 05 Sep 2022 22:53:39 -0700 (PDT) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id s11-20020aa78bcb000000b0053e1c157f62sm857799pfd.71.2022.09.05.22.53.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 05 Sep 2022 22:53:38 -0700 (PDT) Date: Tue, 06 Sep 2022 14:53:36 +0900 (JST) Message-Id: <20220906.145336.1494945638376688936.horikyota.ntt@gmail.com> To: bdrouvot@amazon.com Cc: sawada.mshk@gmail.com, ashutosh.bapat.oss@gmail.com, pgsql-hackers@postgresql.org Subject: Re: more descriptive message for process termination due to max_slot_wal_keep_size From: Kyotaro Horiguchi In-Reply-To: <20211224.173016.2237752923975758130.horikyota.ntt@gmail.com> References: <20220104.102931.1400105396066285349.horikyota.ntt@gmail.com> <20220302.153719.171492355527427161.horikyota.ntt@gmail.com> User-Agent: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Tue_Sep__6_14_53_36_2022_094)--" Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ----Next_Part(Tue_Sep__6_14_53_36_2022_094)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit At Mon, 5 Sep 2022 11:56:33 +0200, "Drouvot, Bertrand" wrote in > Hi, > > On 3/2/22 7:37 AM, Kyotaro Horiguchi wrote: > > At Tue, 04 Jan 2022 10:29:31 +0900 (JST), Kyotaro > > Horiguchi wrote in > >> So what do you say if I propose the following? > >> > >> LOG: terminating process %d to release replication slot \"%s\" > >> because its restart_lsn %X/%X exceeds the limit %X/%X > >> HINT: You might need to increase max_slot_wal_keep_size. > > This version emits the following message. > > > > [35785:checkpointer] LOG: terminating process 36368 to release > > replication slot "s1" because its restart_lsn 0/1F000148 exceeds the > > limit 0/21000000 > > [35785:checkpointer] HINT: You might need to increase > > max_slot_wal_keep_size. > > As the hint is to increase max_slot_wal_keep_size, what about > reporting the difference in size (rather than the limit lsn)? > Something along those lines? > > [35785:checkpointer] LOG: terminating process 36368 to release > replication slot "s1" because its restart_lsn 0/1F000148 exceeds the > limit by . Thanks! That might be more sensible exactly for the reason you mentioned. One issue doing that is size_pretty is dbsize.c local function. Since the size is less than kB in many cases, we cannot use fixed unit for that. 0001 and 0002 are the same with v5. 0003 exposes byte_size_pretty() to other modules. 0004 does the change by using byte_size_pretty() After 0004 applied, they look like this. > LOG: terminating process 108413 to release replication slot "rep3" because its restart_lsn 0/7000D8 exceeds the limit by 1024 kB > HINT: You might need to increase max_slot_wal_keep_size. The reason for "1024 kB" instead of "1 MB" is the precise value is a bit less than 1024 * 1024. regards. - Kyotaro Horiguchi NTT Open Source Software Center ----Next_Part(Tue_Sep__6_14_53_36_2022_094)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="v6-0001-Make-a-message-on-process-termination-more-dscrip.patch"