Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8a2f5d2

Browse files
committed
Reduce unnecessary PANIC to ERROR, improve a couple of comments.
1 parente7b498b commit8a2f5d2

File tree

1 file changed

+11
-15
lines changed
  • src/backend/access/transam

1 file changed

+11
-15
lines changed

‎src/backend/access/transam/xlog.c

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.309 2008/05/14 14:02:57 mha Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.310 2008/05/16 19:15:05 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -67,6 +67,7 @@ boolXLogArchiveMode = false;
6767
char*XLogArchiveCommand=NULL;
6868
boolfullPageWrites= true;
6969
boollog_checkpoints= false;
70+
intsync_method=DEFAULT_SYNC_METHOD;
7071

7172
#ifdefWAL_DEBUG
7273
boolXLOG_DEBUG= false;
@@ -88,8 +89,6 @@ boolXLOG_DEBUG = false;
8889
/*
8990
* GUC support
9091
*/
91-
intsync_method=DEFAULT_SYNC_METHOD;
92-
9392
conststructconfig_enum_entrysync_method_options[]= {
9493
{"fsync",SYNC_METHOD_FSYNC},
9594
#ifdefHAVE_FSYNC_WRITETHROUGH
@@ -1613,7 +1612,8 @@ XLogWrite(XLogwrtRqst WriteRqst, bool flexible, bool xlog_switch)
16131612
* have no open file or the wrong one.However, we do not need to
16141613
* fsync more than one file.
16151614
*/
1616-
if (sync_method!=SYNC_METHOD_OPEN&&sync_method!=SYNC_METHOD_OPEN_DSYNC)
1615+
if (sync_method!=SYNC_METHOD_OPEN&&
1616+
sync_method!=SYNC_METHOD_OPEN_DSYNC)
16171617
{
16181618
if (openLogFile >=0&&
16191619
!XLByteInPrevSeg(LogwrtResult.Write,openLogId,openLogSeg))
@@ -6340,10 +6340,10 @@ get_sync_bit(int method)
63406340
switch (method)
63416341
{
63426342
/*
6343-
*Valuesforthese sync options are defined even if they are not
6344-
* supported on the current platform.They arenot included in
6345-
* the enum option array, andtherefor will never beset if the
6346-
*platform doesn't support it.
6343+
*enum valuesforall sync options are defined even if they are not
6344+
* supported on the current platform. But ifnot, they are not
6345+
*included inthe enum option array, andtherefore will never beseen
6346+
*here.
63476347
*/
63486348
caseSYNC_METHOD_FSYNC:
63496349
caseSYNC_METHOD_FSYNC_WRITETHROUGH:
@@ -6358,12 +6358,8 @@ get_sync_bit(int method)
63586358
returnOPEN_DATASYNC_FLAG;
63596359
#endif
63606360
default:
6361-
/*
6362-
* This "can never happen", since the available values in
6363-
* new_sync_method are controlled by the available enum
6364-
* options.
6365-
*/
6366-
elog(PANIC,"unrecognized wal_sync_method: %d",method);
6361+
/* can't happen (unless we are out of sync with option array) */
6362+
elog(ERROR,"unrecognized wal_sync_method: %d",method);
63676363
return0;/* silence warning */
63686364
}
63696365
}
@@ -6392,7 +6388,7 @@ assign_xlog_sync_method(int new_sync_method, bool doit, GucSource source)
63926388
(errcode_for_file_access(),
63936389
errmsg("could not fsync log file %u, segment %u: %m",
63946390
openLogId,openLogSeg)));
6395-
if (get_sync_bit(sync_method)!=get_sync_bit(new_sync_method))
6391+
if (get_sync_bit(sync_method)!=get_sync_bit(new_sync_method))
63966392
XLogFileClose();
63976393
}
63986394
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp