Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rXPG9-00AU49-4B for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Feb 2024 17:29:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rXPG8-005W0l-0u for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Feb 2024 17:29:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rXPG7-005W0d-O8 for pgsql-hackers@lists.postgresql.org; Tue, 06 Feb 2024 17:29:23 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rXPG0-005nit-ME for pgsql-hackers@lists.postgresql.org; Tue, 06 Feb 2024 17:29:23 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 416HTAck524752; Tue, 6 Feb 2024 12:29:10 -0500 From: Tom Lane To: Nathan Bossart cc: Michael Banck , Laurenz Albe , pgsql-hackers@lists.postgresql.org Subject: Re: Set log_lock_waits=on by default In-reply-to: <20240206165343.GA3841415@nathanxps13> References: <659ffa38.170a0220.eea6a.28fc@mx.google.com> <65b146b9.170a0220.c645b.0891@mx.google.com> <20240206165343.GA3841415@nathanxps13> Comments: In-reply-to Nathan Bossart message dated "Tue, 06 Feb 2024 10:53:43 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <524750.1707240550.1@sss.pgh.pa.us> Date: Tue, 06 Feb 2024 12:29:10 -0500 Message-ID: <524751.1707240550@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Nathan Bossart writes: > It looks like there are two ideas: > * Separate log_lock_waits from deadlock_timeout. It looks like this idea > has a decent amount of support, but I didn't see any patch for it so far. I think the support comes from people who have not actually looked at the code. The reason they are not separate is that the same timeout service routine does both things. To pull them apart, you would have to (1) detangle that code and (2) incur the overhead of two timeout events queued for every lock wait. It's not clear to me that it's worth it. In some sense, deadlock_timeout is exactly the length of time after which you want to get concerned. > IMHO this is arguably a prerequisite for setting log_lock_waits on by > default, as we could then easily set it higher by default to help address > concerns about introducing too much noise in the logs. Well, that's the question --- would it be sane to enable log_lock_waits by default if we don't separate them? > * Set log_lock_waits on by default. The folks on this thread seem to > support this idea, but given the lively discussion for enabling > log_checkpoints by default [0], I'm hesitant to commit something like > this without further community discussion. I was, and remain, of the opinion that that was a bad idea that we'll eventually revert, just like we previously got rid of most inessential log chatter in the default configuration. So I doubt you'll have much trouble guessing my opinion of this one. I think the default logging configuration should be chosen with the understanding that nobody ever looks at the logs of most installations, and we should be more worried about their disk space consumption than anything else. Admittedly, log_lock_waits is less bad than log_checkpoints, because no such events will occur in a well-tuned configuration ... but still, it's going to be useless chatter in the average installation. regards, tom lane