Skip to content

Commit a396e20

Browse files
Rename variable for code clarity
When tracking IO timing for WAL, the duration is what we calculate based on the start and end timestamps, it's not what the variable contains. Rename the timestamp variable to end to better communicate what it contains. Original patch by Krishnakumar with additional hacking to fix another occurrence by me. Author: Krishnakumar R <kksrcv001@gmail.com> Discussion: https://postgr.es/m/CAPMWgZ9f9o8awrQpjo8oxnNQ=bMDVPx00NE0QcDzvHD_ZrdLPw@mail.gmail.com
1 parent 18724af commit a396e20

File tree

1 file changed

+6
-6
lines changed
  • src/backend/access/transam

1 file changed

+6
-6
lines changed

src/backend/access/transam/xlog.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2226,10 +2226,10 @@ XLogWrite(XLogwrtRqst WriteRqst, TimeLineID tli, bool flexible)
22262226
*/
22272227
if (track_wal_io_timing)
22282228
{
2229-
instr_time duration;
2229+
instr_time end;
22302230

2231-
INSTR_TIME_SET_CURRENT(duration);
2232-
INSTR_TIME_ACCUM_DIFF(PendingWalStats.wal_write_time, duration, start);
2231+
INSTR_TIME_SET_CURRENT(end);
2232+
INSTR_TIME_ACCUM_DIFF(PendingWalStats.wal_write_time, end, start);
22332233
}
22342234

22352235
PendingWalStats.wal_write++;
@@ -8252,10 +8252,10 @@ issue_xlog_fsync(int fd, XLogSegNo segno, TimeLineID tli)
82528252
*/
82538253
if (track_wal_io_timing)
82548254
{
8255-
instr_time duration;
8255+
instr_time end;
82568256

8257-
INSTR_TIME_SET_CURRENT(duration);
8258-
INSTR_TIME_ACCUM_DIFF(PendingWalStats.wal_sync_time, duration, start);
8257+
INSTR_TIME_SET_CURRENT(end);
8258+
INSTR_TIME_ACCUM_DIFF(PendingWalStats.wal_sync_time, end, start);
82598259
}
82608260

82618261
PendingWalStats.wal_sync++;

0 commit comments

Comments
 (0)