Re-add tracking of wait event SLRUFlushSync
authorMichael Paquier <[email protected]>
Tue, 25 Apr 2023 22:30:47 +0000 (07:30 +0900)
committerMichael Paquier <[email protected]>
Tue, 25 Apr 2023 22:30:47 +0000 (07:30 +0900)
SLRUFlushSync has been accidently removed during dee663f, that has moved
the flush of the SLRU files to the checkpointer, so add it back.  The
issue has been noticed by Thomas when checking for orphaned wait
events.

Author: Thomas Munro
Reviewed-by: Bharath Rupireddy
Discussion: https://postgr.es/m/CA+hUKGK6tqm59KuF1z+h5Y8fsWcu5v8+84kduSHwRzwjB2aa_A@mail.gmail.com

src/backend/access/transam/slru.c

index 7273d61b15aa3a37d900278e6f1624c7ae8949dd..3ee01ef1a21f887f3a81ebeaeb0c3fb5affdc3e0 100644 (file)
@@ -1602,7 +1602,9 @@ SlruSyncFileTag(SlruCtl ctl, const FileTag *ftag, char *path)
    if (fd < 0)
        return -1;
 
+   pgstat_report_wait_start(WAIT_EVENT_SLRU_FLUSH_SYNC);
    result = pg_fsync(fd);
+   pgstat_report_wait_end();
    save_errno = errno;
 
    CloseTransientFile(fd);