Re: [PATCH] Identify LWLocks in tracepoints
Peter Eisentraut <peter.eisentraut@enterprisedb.com>
From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Craig Ringer <craig.ringer@enterprisedb.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2021-03-19T20:06:40Z
Lists: pgsql-hackers
On 18.03.21 07:34, Craig Ringer wrote: > In patch 0001, why was the TRACE_POSTGRESQL_LWLOCK_RELEASE() call > moved? > Is there some correctness issue? If so, we should explain that (at > least in the commit message, or as a separate patch). > > > If you want I can split it out, or drop that change. I thought it was > sufficiently inconsequential, but you're right to check. > > The current tracepoint TRACE_POSTGRESQL_LWLOCK_RELEASE really means > "releaseD". It's appropriate to emit this as soon as the lock could be > acquired by anything else. By deferring it until we'd processed the > waitlist and woken other backends the window during which the lock was > reported as "held" was longer than it truly was, and it was easy to see > one backend acquire the lock while another still appeared to hold it. From the archeology department: The TRACE_POSTGRESQL_LWLOCK_RELEASE probe was in the right place until PG 9.4, but was then moved by ab5194e6f617a9a9e7aadb3dd1cee948a42d0755, which was a major rewrite, so it seems the move might have been accidental. The documentation specifically states that the probe is triggered before waiters are woken up, which it specifically does not do at the moment. So this looks like a straight bug fix to me.
Commits
-
Emit dummy statements for probes.d probes when disabled
- 0d204a4b09f7 13.3 landed
- fa8fbadb934b 14.0 landed
-
Prevent lwlock dtrace probes from unnecessary work
- e48ce7ef0ef8 13.3 landed
- b94409a02f61 14.0 landed
-
doc: Fix typo in logicaldecoding.sgml.
- 5fe83adad9ef 14.0 cited
-
Move lwlock-release probe back where it belongs
- 96ae658e6238 14.0 landed
-
Remove bogus tracepoint
- 09418bed67a7 14.0 landed
-
Simplify LWLock tranche machinery by removing array_base/array_stride.
- 3761fe3c20bb 10.0 cited
-
Improve LWLock scalability.
- ab5194e6f617 9.5.0 cited