mirror of
https://github.com/postgres/postgres.git
synced 2026-05-27 12:00:13 -04:00
bufmgr: use I/O stats arguments in FlushUnlockedBuffer()
FlushUnlockedBuffer() accepted io_object and io_context arguments but hardcoded IOOBJECT_RELATION and IOCONTEXT_NORMAL when calling FlushBuffer(). Pass them through instead. Also fix FlushBuffer() to use its io_object parameter for I/O timing stats rather than hardcoding IOOBJECT_RELATION. Not actively broken since all current callers pass IOOBJECT_RELATION and IOCONTEXT_NORMAL, so not backpatched. Author: Chao Li <lic@highgo.com> Reviewed-by: Melanie Plageman <melanieplageman@gmail.com> Discussion: https://postgr.es/m/BC97546F-5C15-42F2-AD57-CFACDB9657D0@gmail.com
This commit is contained in:
parent
62407d26b7
commit
31b0544b32
1 changed files with 2 additions and 2 deletions
|
|
@ -4598,7 +4598,7 @@ FlushBuffer(BufferDesc *buf, SMgrRelation reln, IOObject io_object,
|
|||
* When a strategy is not in use, the write can only be a "regular" write
|
||||
* of a dirty shared buffer (IOCONTEXT_NORMAL IOOP_WRITE).
|
||||
*/
|
||||
pgstat_count_io_op_time(IOOBJECT_RELATION, io_context,
|
||||
pgstat_count_io_op_time(io_object, io_context,
|
||||
IOOP_WRITE, io_start, 1, BLCKSZ);
|
||||
|
||||
pgBufferUsage.shared_blks_written++;
|
||||
|
|
@ -4629,7 +4629,7 @@ FlushUnlockedBuffer(BufferDesc *buf, SMgrRelation reln,
|
|||
Buffer buffer = BufferDescriptorGetBuffer(buf);
|
||||
|
||||
BufferLockAcquire(buffer, buf, BUFFER_LOCK_SHARE_EXCLUSIVE);
|
||||
FlushBuffer(buf, reln, IOOBJECT_RELATION, IOCONTEXT_NORMAL);
|
||||
FlushBuffer(buf, reln, io_object, io_context);
|
||||
BufferLockUnlock(buffer, buf);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue