mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Provide much better wait information in pg_stat_activity.
When a process is waiting for a heavyweight lock, we will now indicate the type of heavyweight lock for which it is waiting. Also, you can now see when a process is waiting for a lightweight lock - in which case we will indicate the individual lock name or the tranche, as appropriate - or for a buffer pin. Amit Kapila, Ildus Kurbangaliev, reviewed by me. Lots of helpful discussion and suggestions by many others, including Alexander Korotkov, Vladimir Borodin, and many others.
This commit is contained in:
@ -2447,13 +2447,14 @@ AbortTransaction(void)
|
||||
*/
|
||||
LWLockReleaseAll();
|
||||
|
||||
/* Clear wait information and command progress indicator */
|
||||
pgstat_report_wait_end();
|
||||
pgstat_progress_end_command();
|
||||
|
||||
/* Clean up buffer I/O and buffer context locks, too */
|
||||
AbortBufferIO();
|
||||
UnlockBuffers();
|
||||
|
||||
/* Clear command progress indicator */
|
||||
pgstat_progress_end_command();
|
||||
|
||||
/* Reset WAL record construction state */
|
||||
XLogResetInsertion();
|
||||
|
||||
@ -4541,9 +4542,10 @@ AbortSubTransaction(void)
|
||||
*/
|
||||
LWLockReleaseAll();
|
||||
|
||||
pgstat_report_wait_end();
|
||||
pgstat_progress_end_command();
|
||||
AbortBufferIO();
|
||||
UnlockBuffers();
|
||||
pgstat_progress_end_command();
|
||||
|
||||
/* Reset WAL record construction state */
|
||||
XLogResetInsertion();
|
||||
@ -4653,6 +4655,9 @@ AbortSubTransaction(void)
|
||||
*/
|
||||
XactReadOnly = s->prevXactReadOnly;
|
||||
|
||||
/* Report wait end here, when there is no further possibility of wait */
|
||||
pgstat_report_wait_end();
|
||||
|
||||
RESUME_INTERRUPTS();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user