mirror of
https://github.com/postgres/postgres.git
synced 2025-11-24 00:23:06 +03:00
Add writeback to pg_stat_io
28e626bde0added the concept of IOOps but neglected to include writeback operations.ac8d53dae5added time spent doing these I/O operations. Without counting writeback, checkpointer write time in the log often differed substantially from that in pg_stat_io. To fix this, add IOOp IOOP_WRITEBACK and track writeback in pg_stat_io. Bumps catversion. Author: Melanie Plageman <melanieplageman@gmail.com> Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Reported-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/20230419172326.dhgyo4wrrhulovt6%40awork3.anarazel.de
This commit is contained in:
@@ -424,6 +424,14 @@ pgstat_tracks_io_op(BackendType bktype, IOObject io_object,
|
||||
bktype == B_CHECKPOINTER) && io_op == IOOP_EXTEND)
|
||||
return false;
|
||||
|
||||
/*
|
||||
* Temporary tables are not logged and thus do not require fsync'ing.
|
||||
* Writeback is not requested for temporary tables.
|
||||
*/
|
||||
if (io_object == IOOBJECT_TEMP_RELATION &&
|
||||
(io_op == IOOP_FSYNC || io_op == IOOP_WRITEBACK))
|
||||
return false;
|
||||
|
||||
/*
|
||||
* Some IOOps are not valid in certain IOContexts and some IOOps are only
|
||||
* valid in certain contexts.
|
||||
@@ -448,12 +456,6 @@ pgstat_tracks_io_op(BackendType bktype, IOObject io_object,
|
||||
if (strategy_io_context && io_op == IOOP_FSYNC)
|
||||
return false;
|
||||
|
||||
/*
|
||||
* Temporary tables are not logged and thus do not require fsync'ing.
|
||||
*/
|
||||
if (io_context == IOCONTEXT_NORMAL &&
|
||||
io_object == IOOBJECT_TEMP_RELATION && io_op == IOOP_FSYNC)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user