mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
Create and use wait events for read, write, and fsync operations.
Previous commits, notably53be0b1add
and6f3bd98ebf
, made it possible to see from pg_stat_activity when a backend was stuck waiting for another backend, but it's also fairly common for a backend to be stuck waiting for an I/O. Add wait events for those operations, too. Rushabh Lathia, with further hacking by me. Reviewed and tested by Michael Paquier, Amit Kapila, Rajkumar Raghuwanshi, and Rahila Syed. Discussion: http://postgr.es/m/CAGPqQf0LsYHXREPAZqYGVkDqHSyjf=KsD=k0GTVPAuzyThh-VQ@mail.gmail.com
This commit is contained in:
@ -60,6 +60,7 @@
|
||||
#ifdef HAVE_SYS_SHM_H
|
||||
#include <sys/shm.h>
|
||||
#endif
|
||||
#include "pgstat.h"
|
||||
|
||||
#include "portability/mem.h"
|
||||
#include "storage/dsm_impl.h"
|
||||
@ -911,10 +912,12 @@ dsm_impl_mmap(dsm_op op, dsm_handle handle, Size request_size,
|
||||
|
||||
if (goal > ZBUFFER_SIZE)
|
||||
goal = ZBUFFER_SIZE;
|
||||
pgstat_report_wait_start(WAIT_EVENT_DSM_FILL_ZERO_WRITE);
|
||||
if (write(fd, zbuffer, goal) == goal)
|
||||
remaining -= goal;
|
||||
else
|
||||
success = false;
|
||||
pgstat_report_wait_end();
|
||||
}
|
||||
|
||||
if (!success)
|
||||
|
Reference in New Issue
Block a user