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

Commitd04e913

Browse files
committed
Reverse out XLogDir/-X write-ahead log handling, per discussion.
Original patch from Thomas.
1 parent7c02c86 commitd04e913

File tree

8 files changed

+57
-157
lines changed

8 files changed

+57
-157
lines changed

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

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.101 2002/08/06 02:36:33 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.102 2002/08/17 15:12:06 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -398,8 +398,7 @@ static ControlFileData *ControlFile = NULL;
398398

399399

400400
/* File path names */
401-
char*XLogDir=NULL;
402-
401+
staticcharXLogDir[MAXPGPATH];
403402
staticcharControlFilePath[MAXPGPATH];
404403

405404
/*
@@ -2075,29 +2074,11 @@ ValidXLOGHeader(XLogPageHeader hdr, int emode, bool checkSUI)
20752074
* I/O and compatibility-check functions, but there seems no need currently.
20762075
*/
20772076

2078-
void
2079-
SetXLogDir(char*path)
2080-
{
2081-
char*xsubdir="/pg_xlog";
2082-
2083-
if (path!=NULL)
2084-
{
2085-
XLogDir=malloc(strlen(path)+1);
2086-
strcpy(XLogDir,path);
2087-
}
2088-
else
2089-
{
2090-
XLogDir=malloc(strlen(DataDir)+strlen(xsubdir)+1);
2091-
snprintf(XLogDir,MAXPGPATH,"%s%s",DataDir,xsubdir);
2092-
}
2093-
}
2094-
20952077
void
20962078
XLOGPathInit(void)
20972079
{
20982080
/* Init XLOG file paths */
2099-
if (XLogDir==NULL)
2100-
SetXLogDir(NULL);
2081+
snprintf(XLogDir,MAXPGPATH,"%s/pg_xlog",DataDir);
21012082
snprintf(ControlFilePath,MAXPGPATH,"%s/global/pg_control",DataDir);
21022083
}
21032084

‎src/backend/bootstrap/bootstrap.c‎

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.137 2002/08/10 20:29:17 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.138 2002/08/17 15:12:06 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -222,7 +222,6 @@ BootstrapMain(int argc, char *argv[])
222222
intflag;
223223
intxlogop=BS_XLOG_NOP;
224224
char*potential_DataDir=NULL;
225-
char*potential_XLogDir=NULL;
226225

227226
/*
228227
* initialize globals
@@ -249,22 +248,17 @@ BootstrapMain(int argc, char *argv[])
249248
if (!IsUnderPostmaster)
250249
{
251250
InitializeGUCOptions();
252-
/* Null if no PGDATA variable */
253-
potential_DataDir=getenv("PGDATA");
254-
/* Null if no PGXLOG variable */
255-
potential_XLogDir=getenv("PGXLOG");
251+
potential_DataDir=getenv("PGDATA");/* Null if no PGDATA
252+
* variable */
256253
}
257254

258-
while ((flag=getopt(argc,argv,"B:d:D:X:Fo:px:"))!=-1)
255+
while ((flag=getopt(argc,argv,"B:d:D:Fo:px:"))!=-1)
259256
{
260257
switch (flag)
261258
{
262259
case'D':
263260
potential_DataDir=optarg;
264261
break;
265-
case'X':
266-
potential_XLogDir=optarg;
267-
break;
268262
case'd':
269263
{
270264
/* Turn on debugging for the bootstrap process. */
@@ -319,7 +313,6 @@ BootstrapMain(int argc, char *argv[])
319313
proc_exit(1);
320314
}
321315
SetDataDir(potential_DataDir);
322-
SetXLogDir(potential_XLogDir);
323316
}
324317

325318
/* Validate we have been given a reasonable-looking DataDir */

‎src/backend/postmaster/postmaster.c‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.283 2002/08/10 20:29:18 momjian Exp $
40+
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.284 2002/08/17 15:12:06 momjian Exp $
4141
*
4242
* NOTES
4343
*
@@ -346,7 +346,6 @@ PostmasterMain(int argc, char *argv[])
346346
intstatus;
347347
charoriginal_extraoptions[MAXPGPATH];
348348
char*potential_DataDir=NULL;
349-
char*potential_XLogDir=NULL;
350349

351350
*original_extraoptions='\0';
352351

@@ -404,11 +403,10 @@ PostmasterMain(int argc, char *argv[])
404403
InitializeGUCOptions();
405404

406405
potential_DataDir=getenv("PGDATA");/* default value */
407-
potential_XLogDir=getenv("PGXLOG");/* default value */
408406

409407
opterr=1;
410408

411-
while ((opt=getopt(argc,argv,"A:a:B:b:c:D:X:d:Fh:ik:lm:MN:no:p:Ss-:"))!=-1)
409+
while ((opt=getopt(argc,argv,"A:a:B:b:c:D:d:Fh:ik:lm:MN:no:p:Ss-:"))!=-1)
412410
{
413411
switch (opt)
414412
{
@@ -431,9 +429,6 @@ PostmasterMain(int argc, char *argv[])
431429
case'D':
432430
potential_DataDir=optarg;
433431
break;
434-
case'X':
435-
potential_XLogDir=optarg;
436-
break;
437432
case'd':
438433
{
439434
/* Turn on debugging for the postmaster. */
@@ -568,7 +563,6 @@ PostmasterMain(int argc, char *argv[])
568563

569564
checkDataDir(potential_DataDir);/* issues error messages */
570565
SetDataDir(potential_DataDir);
571-
SetXLogDir(potential_XLogDir);
572566

573567
ProcessConfigFile(PGC_POSTMASTER);
574568

‎src/backend/tcop/postgres.c‎

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.282 2002/08/15 16:36:05 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.283 2002/08/17 15:12:07 momjian Exp $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -1120,7 +1120,6 @@ PostgresMain(int argc, char *argv[], const char *username)
11201120
StringInfoparser_input;
11211121

11221122
char*potential_DataDir=NULL;
1123-
char*potential_XLogDir=NULL;
11241123

11251124
/*
11261125
* Catch standard options before doing much else. This even works on
@@ -1164,7 +1163,6 @@ PostgresMain(int argc, char *argv[], const char *username)
11641163
{
11651164
InitializeGUCOptions();
11661165
potential_DataDir=getenv("PGDATA");
1167-
potential_XLogDir=getenv("PGXLOG");
11681166
}
11691167

11701168
/* ----------------
@@ -1189,7 +1187,7 @@ PostgresMain(int argc, char *argv[], const char *username)
11891187
ctx=PGC_POSTMASTER;
11901188
gucsource=PGC_S_ARGV;/* initial switches came from command line */
11911189

1192-
while ((flag=getopt(argc,argv,"A:B:c:CD:X:d:Eef:FiNOPo:p:S:st:v:W:x:-:"))!=-1)
1190+
while ((flag=getopt(argc,argv,"A:B:c:CD:d:Eef:FiNOPo:p:S:st:v:W:x:-:"))!=-1)
11931191
switch (flag)
11941192
{
11951193
case'A':
@@ -1221,11 +1219,6 @@ PostgresMain(int argc, char *argv[], const char *username)
12211219
potential_DataDir=optarg;
12221220
break;
12231221

1224-
case'X':/* PGXLOG directory */
1225-
if (secure)
1226-
potential_XLogDir=optarg;
1227-
break;
1228-
12291222
case'd':/* debug level */
12301223
{
12311224
/* Set server debugging level. */
@@ -1517,7 +1510,6 @@ PostgresMain(int argc, char *argv[], const char *username)
15171510
proc_exit(1);
15181511
}
15191512
SetDataDir(potential_DataDir);
1520-
SetXLogDir(potential_XLogDir);
15211513
}
15221514
Assert(DataDir);
15231515

@@ -1674,7 +1666,7 @@ PostgresMain(int argc, char *argv[], const char *username)
16741666
if (!IsUnderPostmaster)
16751667
{
16761668
puts("\nPOSTGRES backend interactive interface ");
1677-
puts("$Revision: 1.282 $ $Date: 2002/08/15 16:36:05 $\n");
1669+
puts("$Revision: 1.283 $ $Date: 2002/08/17 15:12:07 $\n");
16781670
}
16791671

16801672
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp