Skip to content

Commit 9b8dd7e

Browse files
committed
Fix erroneous choices of segNo variables
Commit dfda6eb (which changed segment numbers to use a single 64 bit variable instead of log/seg) introduced a couple of bogus choices of exactly which log segment number variable to use in each case. This is currently pretty harmless; in one place, the bogus number was only being used in an error message for a pretty unlikely condition (failure to fsync a WAL segment file). In the other, it was using a global variable instead of the local variable; but all callsites were passing the value of the global variable anyway. No need to backpatch because that commit is not on earlier branches.
1 parent 04f28bd commit 9b8dd7e

File tree

1 file changed

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

1 file changed

+4
-4
lines changed

src/backend/access/transam/xlog.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8175,7 +8175,7 @@ assign_xlog_sync_method(int new_sync_method, void *extra)
81758175
ereport(PANIC,
81768176
(errcode_for_file_access(),
81778177
errmsg("could not fsync log segment %s: %m",
8178-
XLogFileNameP(curFileTLI, readSegNo))));
8178+
XLogFileNameP(curFileTLI, openLogSegNo))));
81798179
if (get_sync_bit(sync_method) != get_sync_bit(new_sync_method))
81808180
XLogFileClose();
81818181
}
@@ -8199,15 +8199,15 @@ issue_xlog_fsync(int fd, XLogSegNo segno)
81998199
ereport(PANIC,
82008200
(errcode_for_file_access(),
82018201
errmsg("could not fsync log file %s: %m",
8202-
XLogFileNameP(ThisTimeLineID, openLogSegNo))));
8202+
XLogFileNameP(ThisTimeLineID, segno))));
82038203
break;
82048204
#ifdef HAVE_FSYNC_WRITETHROUGH
82058205
case SYNC_METHOD_FSYNC_WRITETHROUGH:
82068206
if (pg_fsync_writethrough(fd) != 0)
82078207
ereport(PANIC,
82088208
(errcode_for_file_access(),
82098209
errmsg("could not fsync write-through log file %s: %m",
8210-
XLogFileNameP(ThisTimeLineID, openLogSegNo))));
8210+
XLogFileNameP(ThisTimeLineID, segno))));
82118211
break;
82128212
#endif
82138213
#ifdef HAVE_FDATASYNC
@@ -8216,7 +8216,7 @@ issue_xlog_fsync(int fd, XLogSegNo segno)
82168216
ereport(PANIC,
82178217
(errcode_for_file_access(),
82188218
errmsg("could not fdatasync log file %s: %m",
8219-
XLogFileNameP(ThisTimeLineID, openLogSegNo))));
8219+
XLogFileNameP(ThisTimeLineID, segno))));
82208220
break;
82218221
#endif
82228222
case SYNC_METHOD_OPEN:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy