Skip to content

Commit 593c39d

Browse files
Revoke bc5334d
1 parent d139a5e commit 593c39d

File tree

7 files changed

+7
-74
lines changed

7 files changed

+7
-74
lines changed

doc/src/sgml/config.sgml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -330,22 +330,6 @@ include 'filename'
330330
</listitem>
331331
</varlistentry>
332332

333-
<varlistentry id="guc-recovery-config-directory" xreflabel="recovery_config_directory">
334-
<term><varname>recovery_config_directory</varname> (<type>string</type>)</term>
335-
<indexterm>
336-
<primary><varname>recovery_config_directory</> configuration parameter</primary>
337-
</indexterm>
338-
<listitem>
339-
<para>
340-
Specifies the directory to use for the recovery.conf file. Note
341-
the server requires read and write permission on this directory
342-
because the file will be renamed to recovery.done at the end of
343-
recovery.
344-
This parameter can only be set at server start.
345-
</para>
346-
</listitem>
347-
</varlistentry>
348-
349333
<varlistentry id="guc-config-file" xreflabel="config_file">
350334
<term><varname>config_file</varname> (<type>string</type>)</term>
351335
<indexterm>

src/backend/access/transam/xlog.c

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262

6363
extern bool bootstrap_data_checksums;
6464

65-
char recoveryConfPath[MAXPGPATH];
6665
/* File path names (all relative to $PGDATA) */
6766
#define RECOVERY_COMMAND_FILE "recovery.conf"
6867
#define RECOVERY_COMMAND_DONE "recovery.done"
@@ -4164,16 +4163,15 @@ readRecoveryCommandFile(void)
41644163
*head = NULL,
41654164
*tail = NULL;
41664165

4167-
snprintf(recoveryConfPath, MAXPGPATH, "%s/%s", RecoveryConfDir, RECOVERY_COMMAND_FILE);
4168-
fd = AllocateFile(recoveryConfPath, "r");
4166+
fd = AllocateFile(RECOVERY_COMMAND_FILE, "r");
41694167
if (fd == NULL)
41704168
{
41714169
if (errno == ENOENT)
41724170
return; /* not there, so no archive recovery */
41734171
ereport(FATAL,
41744172
(errcode_for_file_access(),
41754173
errmsg("could not open recovery command file \"%s\": %m",
4176-
recoveryConfPath)));
4174+
RECOVERY_COMMAND_FILE)));
41774175
}
41784176

41794177
/*
@@ -4347,15 +4345,15 @@ readRecoveryCommandFile(void)
43474345
if (PrimaryConnInfo == NULL && recoveryRestoreCommand == NULL)
43484346
ereport(WARNING,
43494347
(errmsg("recovery command file \"%s\" specified neither primary_conninfo nor restore_command",
4350-
recoveryConfPath),
4348+
RECOVERY_COMMAND_FILE),
43514349
errhint("The database server will regularly poll the pg_xlog subdirectory to check for files placed there.")));
43524350
}
43534351
else
43544352
{
43554353
if (recoveryRestoreCommand == NULL)
43564354
ereport(FATAL,
43574355
(errmsg("recovery command file \"%s\" must specify restore_command when standby mode is not enabled",
4358-
recoveryConfPath)));
4356+
RECOVERY_COMMAND_FILE)));
43594357
}
43604358

43614359
/* Enable fetching from archive recovery area */
@@ -4397,7 +4395,6 @@ static void
43974395
exitArchiveRecovery(TimeLineID endTLI, XLogSegNo endLogSegNo)
43984396
{
43994397
char recoveryPath[MAXPGPATH];
4400-
char recoveryDonePath[MAXPGPATH];
44014398
char xlogpath[MAXPGPATH];
44024399

44034400
/*
@@ -4462,13 +4459,12 @@ exitArchiveRecovery(TimeLineID endTLI, XLogSegNo endLogSegNo)
44624459
* Rename the config file out of the way, so that we don't accidentally
44634460
* re-enter archive recovery mode in a subsequent crash.
44644461
*/
4465-
snprintf(recoveryDonePath, MAXPGPATH, "%s/%s", RecoveryConfDir, RECOVERY_COMMAND_DONE);
4466-
unlink(recoveryDonePath);
4467-
if (rename(recoveryConfPath, recoveryDonePath) != 0)
4462+
unlink(RECOVERY_COMMAND_DONE);
4463+
if (rename(RECOVERY_COMMAND_FILE, RECOVERY_COMMAND_DONE) != 0)
44684464
ereport(FATAL,
44694465
(errcode_for_file_access(),
44704466
errmsg("could not rename file \"%s\" to \"%s\": %m",
4471-
recoveryConfPath, recoveryDonePath)));
4467+
RECOVERY_COMMAND_FILE, RECOVERY_COMMAND_DONE)));
44724468

44734469
ereport(LOG,
44744470
(errmsg("archive recovery complete")));

src/backend/utils/init/globals.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ int MyPMChildSlot;
4646
* explicitly.
4747
*/
4848
char *DataDir = NULL;
49-
char *RecoveryConfDir = NULL;
5049

5150
char OutputFileName[MAXPGPATH]; /* debugging output file */
5251

src/backend/utils/init/miscinit.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -99,25 +99,6 @@ SetDataDir(const char *dir)
9999
DataDir = new;
100100
}
101101

102-
/*
103-
* Set recovery config directory, but make sure it's an absolute path. Use this,
104-
* never set RecoveryConfDir directly.
105-
*/
106-
void
107-
SetRecoveryConfDir(const char *dir)
108-
{
109-
char *new;
110-
111-
AssertArg(dir);
112-
113-
/* If presented path is relative, convert to absolute */
114-
new = make_absolute_path(dir);
115-
116-
if (RecoveryConfDir)
117-
free(RecoveryConfDir);
118-
RecoveryConfDir = new;
119-
}
120-
121102
/*
122103
* Change working directory to DataDir. Most of the postmaster and backend
123104
* code assumes that we are in DataDir so it can use relative paths to access

src/backend/utils/misc/guc.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,6 @@ int temp_file_limit = -1;
424424
int num_temp_buffers = 1024;
425425

426426
char *data_directory;
427-
char *recovery_config_directory;
428427
char *ConfigFileName;
429428
char *HbaFileName;
430429
char *IdentFileName;
@@ -2961,17 +2960,6 @@ static struct config_string ConfigureNamesString[] =
29612960
NULL, NULL, NULL
29622961
},
29632962

2964-
{
2965-
{"recovery_config_directory", PGC_POSTMASTER, FILE_LOCATIONS,
2966-
gettext_noop("Sets the server's recovery configuration directory."),
2967-
NULL,
2968-
GUC_SUPERUSER_ONLY
2969-
},
2970-
&recovery_config_directory,
2971-
NULL,
2972-
NULL, NULL, NULL
2973-
},
2974-
29752963
{
29762964
{"config_file", PGC_POSTMASTER, FILE_LOCATIONS,
29772965
gettext_noop("Sets the server's main configuration file."),
@@ -4193,18 +4181,6 @@ SelectConfigFiles(const char *userDoption, const char *progname)
41934181
*/
41944182
SetConfigOption("data_directory", DataDir, PGC_POSTMASTER, PGC_S_OVERRIDE);
41954183

4196-
/*
4197-
* If the recovery_config_directory GUC variable has been set, use that,
4198-
* otherwise use DataDir.
4199-
*
4200-
* Note: SetRecoveryConfDir will copy and absolute-ize its argument,
4201-
* so we don't have to.
4202-
*/
4203-
if (recovery_config_directory)
4204-
SetRecoveryConfDir(recovery_config_directory);
4205-
else
4206-
SetRecoveryConfDir(DataDir);
4207-
42084184
/*
42094185
* If timezone_abbreviations wasn't set in the configuration file, install
42104186
* the default value. We do it this way because we can't safely install a

src/include/miscadmin.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ extern bool IsBinaryUpgrade;
137137
extern bool ExitOnAnyError;
138138

139139
extern PGDLLIMPORT char *DataDir;
140-
extern PGDLLIMPORT char *RecoveryConfDir;
141140

142141
extern PGDLLIMPORT int NBuffers;
143142
extern int MaxBackends;
@@ -302,7 +301,6 @@ extern Oid GetCurrentRoleId(void);
302301
extern void SetCurrentRoleId(Oid roleid, bool is_superuser);
303302

304303
extern void SetDataDir(const char *dir);
305-
extern void SetRecoveryConfDir(const char *dir);
306304
extern void ChangeToDataDir(void);
307305
extern char *make_absolute_path(const char *path);
308306

src/include/utils/guc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ extern int temp_file_limit;
220220
extern int num_temp_buffers;
221221

222222
extern char *data_directory;
223-
extern char *recovery_config_directory;
224223
extern char *ConfigFileName;
225224
extern char *HbaFileName;
226225
extern char *IdentFileName;

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