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 1oW9L8-0006bi-Ps for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Sep 2022 04:40:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oW9L6-0001Ep-RB for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Sep 2022 04:40:32 +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 1oW9L6-0001Eg-7i for pgsql-hackers@lists.postgresql.org; Thu, 08 Sep 2022 04:40:32 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oW9Kz-0002Em-0G for pgsql-hackers@postgresql.org; Thu, 08 Sep 2022 04:40:30 +0000 Received: by mail-pl1-x62c.google.com with SMTP id l10so3409799plb.10 for ; Wed, 07 Sep 2022 21:40:24 -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=VHysnZqcCV5nfIAZ2Hj0cWKnyqgEwNqli0W7IeBVC3s=; b=jW1LuhZ5PIcCeOrKuWqwig1MhyAyZy0FZbLWD0KpEAzH7LpvfMCXW+RkxU5UKDK15T WnsogdHDuaIHG1MSDPskwTskzVUH9B7nJgaxsPLjPSUV7n1LPVwUbO5Z5YQUn1rbzd3k DGF1o67dw4tmsHrwjTl70Uz0xIPKLIV4fuUcrus7FTmj28PEfPJiEIYCI3p+W7RAdjeE NO3C1RiMioWY+wCWUg0yXDLZF3vB1NGv11AhiE/clAZl5t3NEuIwvQ8YmPpkt/NDqdNL 2mUP8fCb5fRHagz42+lphF9+Q6WIzKZKiv++uIfF0+PP4zOyuieAxZ/Im6d2dGyTikjG xSWA== 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=VHysnZqcCV5nfIAZ2Hj0cWKnyqgEwNqli0W7IeBVC3s=; b=ro3LTNPV9LoJcRuyEV2SYt+0yIuRf4CH+yzJAz+kHakpc0T9g3MYNr6pctegPTH46K lb/PntZ70RpOs6sLU9dUnm3m0UQA3kxw+MuGGPZuMkrJPeVihsgYA/GFE2Zf5a9k/s3C jMiGnUdwXR/pMovnoKEx032bKEbKnbgrdb6V87BuGFjc3EUHOQ5/4TgOhtuhoDDr4aqN eGRBpZg91LnNh42VNo0Ypg49VjttyN05jmEYfA94Gs11T4RdtahvvHdTPXt9ex2UiJir JX4B7tIku0MUIQ3o3mnVz77QF15wr8Q6t33SyUpc4gNfvjMhkpen9lPUqjoYBHD/qbHy C49w== X-Gm-Message-State: ACgBeo180o7c95pOlMB0ei6I+UcRsOBF7tf81TJrX7Xn/SUT6F6YBzYa tjqzUveE7Smonar58idpnY4= X-Google-Smtp-Source: AA6agR6WFrZ7JbpNNP6Jp0HfBmffEUt2vi6QUl7UE4m9eKCWIScs19dAnfp2chsodNVd/nPRDfMtBQ== X-Received: by 2002:a17:902:7c01:b0:16f:9649:be73 with SMTP id x1-20020a1709027c0100b0016f9649be73mr7024533pll.70.1662612023787; Wed, 07 Sep 2022 21:40:23 -0700 (PDT) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id b14-20020a1709027e0e00b00174f61a7d09sm13325213plm.247.2022.09.07.21.40.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 07 Sep 2022 21:40:22 -0700 (PDT) Date: Thu, 08 Sep 2022 13:40:20 +0900 (JST) Message-Id: <20220908.134020.228552226800754222.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: <95534909-b8a0-d447-b940-b91006397962@amazon.com> References: <03ee95c3-6496-90b7-5c8b-13fe69ee73dd@amazon.com> <20220907.112019.758274712731312487.horikyota.ntt@gmail.com> <95534909-b8a0-d447-b940-b91006397962@amazon.com> User-Agent: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Thu_Sep__8_13_40_20_2022_816)--" Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ----Next_Part(Thu_Sep__8_13_40_20_2022_816)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit At Wed, 7 Sep 2022 12:16:29 +0200, "Drouvot, Bertrand" wrote in > Also, rounding to zero wouldn't occur with "just" displaying > "oldestLSN - restart_lsn" (as proposed upthread). .. > Yeah right, but that's already the case in some part of the code, like > for example in arrayfuncs.c: Fair points. > >> ereport(LOG, > >> (errmsg("terminating process %d to release replication slot > >> \"%s\" because its restart_lsn %X/%X exceeds the limit by %.1lf > >> MB", > >> active_pid, NameStr(slotname), > >> LSN_FORMAT_ARGS(restart_lsn), > >> /* round-up at sub-MB */ > >> ceil((double) (oldestLSN - restart_lsn) / 1024 / 102.4) / > >> 10), > > typo "/ 102.4" ? No, it rounds the difference up to one decimal place. So it is devided by 10 after ceil():p > >> LOG: terminating process 49539 to release replication slot "rep1" > >> because its restart_lsn 0/3038000 exceeds the limit by 15.8 MB > > If the distance were 1 byte, it is shown as "0.1 MB". > > Right and I'm -1 on it, I think we should stick to the "pretty" or the > "bytes only" approach (my preference being the bytes only one). Okay. the points you brought up above are sufficient grounds for not doing so. Now they are in the following format. >> LOG: terminating process 16034 to release replication slot "rep1" >> because its restart_lsn 0/3158000 exceeds the limit by 15368192 bytes Thank you for the discussion, Bertrand! regards. -- Kyotaro Horiguchi NTT Open Source Software Center ----Next_Part(Thu_Sep__8_13_40_20_2022_816)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="v7-0001-Make-a-message-on-process-termination-more-dscrip.patch"