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 1mwz3q-0000CB-Tp for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Dec 2021 04:05:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mwz3p-0008IM-GE for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Dec 2021 04:05:05 +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 1mwz3p-0008I8-5T for pgsql-hackers@lists.postgresql.org; Tue, 14 Dec 2021 04:05:05 +0000 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mwz3l-0006F4-BB for pgsql-hackers@postgresql.org; Tue, 14 Dec 2021 04:05:04 +0000 Received: by mail-pj1-x1029.google.com with SMTP id j6-20020a17090a588600b001a78a5ce46aso16236452pji.0 for ; Mon, 13 Dec 2021 20:05:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:message-id:to:subject:from:user-agent:mime-version :content-transfer-encoding; bh=2wIsrO4NNHRjombhSSFvFchOJXH61mA6xUI8ooU53qc=; b=GmdK7R6kuRPgBrOx12M6MZoO9HA8ZmUuHvRgRAvZOcn7Qa4gzH+5VmS2aB98f/b82e XM+qrUTCHJdewFp0axPC+vT/MLErs37mDgZkj0EMegQ0fce4MBGDrYhovazeERLE0BOT eZspLkxHFlZZqlYPzjvsWRp9oCrLAxmzN+oYCP7zNhcveHJvBrOlmnVdUghYT72LoLCQ eAPkmPrHL6o77XZfZ8Y3+lhCCTc+SZCUdZq8inVArhCWkEcyjnw5igCDG528ajY+To5y HfXTafeUCEzzKqRBqm1ZwcdO8Ij+0DCesP5ye77N+r6I2n5A7ekqZCi1VGo5hnWD+4pY j62g== 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:subject:from:user-agent :mime-version:content-transfer-encoding; bh=2wIsrO4NNHRjombhSSFvFchOJXH61mA6xUI8ooU53qc=; b=LfnzaFMEk69JmOfjsj4cKcE+2XqlV7LWTcvWZLAdpIse0oKUNGWtSbvin8gzx1VCZv p9zywmmYINRjCu47d1GwSj/yMLh3RxSuaDIWZByTUXkCWAxlYGsknSi2O+77jnosC7L/ DhdjEqXbzEu2jCtwKQ6Za7PMLd38/nQBzSlU9nrpEZj/bBQm5f+ysX7H4RLBEYp8qqMS L3Hqv8jvHrVqO7tr9vOn0+2ULqErk4aTUc2viO+BJXFvxRjfA7U9UalpUZA7Vq3drEex R3r7PC0AlcZQNg2l6Au5+mvQyXsZqF9JJN5ssjG3LG+q1iSawFwQDWebuSgjeotta3Er odeg== X-Gm-Message-State: AOAM533gKscM0pyE3XcjSfGcImLYJw1LtOfaHPKL++9aOm0ClkvZEOus 10J4mKQYUiVwI4eRq5ziB+Mg9k1Du98= X-Google-Smtp-Source: ABdhPJxTSn7ZkAw9stQJRI2ChTMeok74W3S2+50HA7pPp2QJkYc3kHJMe03ysek4PDR5QgFDFvRT6Q== X-Received: by 2002:a17:90a:e506:: with SMTP id t6mr2775979pjy.9.1639454698935; Mon, 13 Dec 2021 20:04:58 -0800 (PST) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id x189sm13430567pfb.158.2021.12.13.20.04.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 13 Dec 2021 20:04:58 -0800 (PST) Date: Tue, 14 Dec 2021 13:04:56 +0900 (JST) Message-Id: <20211214.130456.2233153190058148084.horikyota.ntt@gmail.com> To: pgsql-hackers@postgresql.org Subject: more descriptive message for process termination due to max_slot_wal_keep_size From: Kyotaro Horiguchi User-Agent: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Tue_Dec_14_13_04_56_2021_300)--" Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ----Next_Part(Tue_Dec_14_13_04_56_2021_300)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello. As complained in pgsql-bugs [1], when a process is terminated due to max_slot_wal_keep_size, the related messages don't mention the root cause for *the termination*. Note that the third message does not show for temporary replication slots. [pid=a] LOG: terminating process x to release replication slot "s" [pid=x] LOG: FATAL: terminating connection due to administrator command [pid=a] LOG: invalidting slot "s" because its restart_lsn X/X exceeds max_slot_wal_keep_size The attached patch attaches a DETAIL line to the first message. > [17605] LOG: terminating process 17614 to release replication slot "s1" + [17605] DETAIL: The slot's restart_lsn 0/2C0000A0 exceeds max_slot_wal_keep_size. > [17614] FATAL: terminating connection due to administrator command > [17605] LOG: invalidating slot "s1" because its restart_lsn 0/2C0000A0 exceeds max_slot_wal_keep_size Somewhat the second and fourth lines look inconsistent each other but that wouldn't be such a problem. I don't think we want to concatenate the two lines together as the result is a bit too long. > LOG: terminating process 17614 to release replication slot "s1" because it's restart_lsn 0/2C0000A0 exceeds max_slot_wal_keep_size. What do you think about this? [1] https://www.postgresql.org/message-id/20211214.101137.379073733372253470.horikyota.ntt%40gmail.com -- Kyotaro Horiguchi NTT Open Source Software Center ----Next_Part(Tue_Dec_14_13_04_56_2021_300)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="0001-Make-an-error-message-about-process-termination-more.patch"