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

Commit3619a20

Browse files
committed
Rename the "fast_promote" file to just "promote".
This keeps the usual trigger file name unchanged from 9.2, avoiding nastyissues if you use a pre-9.3 pg_ctl binary with a 9.3 server or vice versa.The fallback behavior of creating a full checkpoint before starting up is nowtriggered by a file called "fallback_promote". That can be useful fordebugging purposes, but we don't expect any users to have to resort to thatand we might want to remove that in the future, which is why the fallbackmechanism is undocumented.
1 parentc64de21 commit3619a20

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ extern uint32 bootstrap_data_checksum_version;
6666
/* File path names (all relative to $PGDATA) */
6767
#defineRECOVERY_COMMAND_FILE"recovery.conf"
6868
#defineRECOVERY_COMMAND_DONE"recovery.done"
69-
#definePROMOTE_SIGNAL_FILE"promote"
70-
#defineFAST_PROMOTE_SIGNAL_FILE "fast_promote"
69+
#definePROMOTE_SIGNAL_FILE"promote"
70+
#defineFALLBACK_PROMOTE_SIGNAL_FILE "fallback_promote"
7171

7272

7373
/* User-settable parameters */
@@ -11082,19 +11082,20 @@ CheckForStandbyTrigger(void)
1108211082
{
1108311083
/*
1108411084
* In 9.1 and 9.2 the postmaster unlinked the promote file inside the
11085-
* signal handler. We now leave the file in place and let the Startup
11086-
* process do the unlink. This allows Startup to know whether we're
11087-
* doing fast or normal promotion. Fast promotion takes precedence.
11085+
* signal handler. It now leaves the file in place and lets the
11086+
* Startup process do the unlink. This allows Startup to know whether
11087+
* it should create a full checkpoint before starting up (fallback
11088+
* mode). Fast promotion takes precedence.
1108811089
*/
11089-
if (stat(FAST_PROMOTE_SIGNAL_FILE,&stat_buf)==0)
11090+
if (stat(PROMOTE_SIGNAL_FILE,&stat_buf)==0)
1109011091
{
11091-
unlink(FAST_PROMOTE_SIGNAL_FILE);
1109211092
unlink(PROMOTE_SIGNAL_FILE);
11093+
unlink(FALLBACK_PROMOTE_SIGNAL_FILE);
1109311094
fast_promote= true;
1109411095
}
11095-
elseif (stat(PROMOTE_SIGNAL_FILE,&stat_buf)==0)
11096+
elseif (stat(FALLBACK_PROMOTE_SIGNAL_FILE,&stat_buf)==0)
1109611097
{
11097-
unlink(PROMOTE_SIGNAL_FILE);
11098+
unlink(FALLBACK_PROMOTE_SIGNAL_FILE);
1109811099
fast_promote= false;
1109911100
}
1110011101

@@ -11130,7 +11131,7 @@ CheckPromoteSignal(void)
1113011131
structstatstat_buf;
1113111132

1113211133
if (stat(PROMOTE_SIGNAL_FILE,&stat_buf)==0||
11133-
stat(FAST_PROMOTE_SIGNAL_FILE,&stat_buf)==0)
11134+
stat(FALLBACK_PROMOTE_SIGNAL_FILE,&stat_buf)==0)
1113411135
return true;
1113511136

1113611137
return false;

‎src/bin/pg_ctl/pg_ctl.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,12 +1099,11 @@ do_promote(void)
10991099
}
11001100

11011101
/*
1102-
* For 9.3 onwards,usefast promotionas the default option. Promotion
1102+
* For 9.3 onwards,"fast" promotionis performed. Promotion
11031103
* with a full checkpoint is still possible by writing a file called
1104-
* "promote", e.g. snprintf(promote_file, MAXPGPATH, "%s/promote",
1105-
* pg_data);
1104+
* "fallback_promote" instead of "promote"
11061105
*/
1107-
snprintf(promote_file,MAXPGPATH,"%s/fast_promote",pg_data);
1106+
snprintf(promote_file,MAXPGPATH,"%s/promote",pg_data);
11081107

11091108
if ((prmfile=fopen(promote_file,"w"))==NULL)
11101109
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp