Re: Set log_lock_waits=on by default

Laurenz Albe <laurenz.albe@cybertec.at>

From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Chao Li <li.evan.chao@gmail.com>
Cc: Shinya Kato <shinya11.kato@gmail.com>, Michael Banck <mbanck@gmx.net>, Tom Lane <tgl@sss.pgh.pa.us>, Nathan Bossart <nathandbossart@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2025-09-08T07:03:24Z
Lists: pgsql-hackers
On Mon, 2025-09-08 at 10:38 +0800, Chao Li wrote:
> I am hesitate to support this change. I agree log_lock_waits is a powerful tool,
> but it’s more like a diagnostic tool. On a high-concurrency system with many tractions
> running at the same time, it may quickly fill up log files and make it difficult
> to find other errors. So, we usually only turn it on when needed, and turn it off
> once debugging is done.

You still can do that - only the default changed.

I think that if your log fills up with messages indicating that sessions are stuck
behind a lock for more than one second, and it is a high concurrency system, you
have got a severe problem that you want to know about.

What I argue is that while log_lock_waits=on is not the correct setting for
everybody, it is the correct setting for the vast majority of databases.

Yours,
Laurenz Albe



Commits

  1. Default to log_lock_waits=on

  2. Generate GUC tables from .dat file