Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
df238b2c
Commit
df238b2c
authored
Mar 20, 2000
by
Vadim B. Mikheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turn XLOG off (do not create log file).
parent
3caa56fe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
5 deletions
+36
-5
src/backend/access/transam/xlog.c
src/backend/access/transam/xlog.c
+36
-5
No files found.
src/backend/access/transam/xlog.c
View file @
df238b2c
...
...
@@ -6,10 +6,11 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.1
1 2000/03/07 23:49:31 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.1
2 2000/03/20 07:25:39 vadim
Exp $
*
*-------------------------------------------------------------------------
*/
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
...
...
@@ -76,6 +77,13 @@ typedef struct XLogCtlWrite
uint16
curridx
;
/* index of next block to write */
}
XLogCtlWrite
;
#ifndef HAS_TEST_AND_SET
#define TAS(lck) 0
#define S_UNLOCK(lck)
#define S_INIT_LOCK(lck)
#endif
typedef
struct
XLogCtlData
{
XLogCtlInsert
Insert
;
...
...
@@ -1153,9 +1161,12 @@ BootStrapXLOG()
{
int
fd
;
char
buffer
[
BLCKSZ
];
XLogPageHeader
page
=
(
XLogPageHeader
)
buffer
;
CheckPoint
checkPoint
;
#ifdef NOT_USED
XLogPageHeader
page
=
(
XLogPageHeader
)
buffer
;
XLogRecord
*
record
;
#endif
#ifndef __CYGWIN__
fd
=
open
(
ControlFilePath
,
O_RDWR
|
O_CREAT
|
O_EXCL
,
S_IRUSR
|
S_IWUSR
);
...
...
@@ -1166,14 +1177,14 @@ BootStrapXLOG()
elog
(
STOP
,
"BootStrapXLOG failed to create control file (%s): %d"
,
ControlFilePath
,
errno
);
logFile
=
XLogFileInit
(
0
,
0
);
checkPoint
.
redo
.
xlogid
=
0
;
checkPoint
.
redo
.
xrecoff
=
SizeOfXLogPHD
;
checkPoint
.
undo
=
checkPoint
.
redo
;
checkPoint
.
nextXid
=
FirstTransactionId
;
checkPoint
.
nextOid
=
BootstrapObjectIdData
;
#ifdef NOT_USED
memset
(
buffer
,
0
,
BLCKSZ
);
page
->
xlp_magic
=
XLOG_PAGE_MAGIC
;
page
->
xlp_info
=
0
;
...
...
@@ -1186,6 +1197,8 @@ BootStrapXLOG()
record
->
xl_rmid
=
RM_XLOG_ID
;
memcpy
((
char
*
)
record
+
SizeOfXLogRecord
,
&
checkPoint
,
sizeof
(
checkPoint
));
logFile
=
XLogFileInit
(
0
,
0
);
if
(
write
(
logFile
,
buffer
,
BLCKSZ
)
!=
BLCKSZ
)
elog
(
STOP
,
"BootStrapXLOG failed to write logfile: %d"
,
errno
);
...
...
@@ -1195,6 +1208,8 @@ BootStrapXLOG()
close
(
logFile
);
logFile
=
-
1
;
#endif
memset
(
buffer
,
0
,
BLCKSZ
);
ControlFile
=
(
ControlFileData
*
)
buffer
;
ControlFile
->
logId
=
0
;
...
...
@@ -1233,15 +1248,17 @@ str_time(time_t tnow)
void
StartupXLOG
()
{
#ifdef NOT_USED
XLogCtlInsert
*
Insert
;
CheckPoint
checkPoint
;
XLogRecPtr
RecPtr
,
LastRec
;
XLogRecord
*
record
;
char
buffer
[
MAXLOGRECSZ
+
SizeOfXLogRecord
];
int
fd
;
int
recovery
=
0
;
bool
sie_saved
=
false
;
#endif
int
fd
;
elog
(
LOG
,
"Data Base System is starting up at %s"
,
str_time
(
time
(
NULL
)));
...
...
@@ -1321,6 +1338,8 @@ tryAgain:
elog
(
LOG
,
"Data Base System was interrupted being in production at %s"
,
str_time
(
ControlFile
->
time
));
#ifdef NOT_USED
LastRec
=
RecPtr
=
ControlFile
->
checkPoint
;
if
(
!
XRecOffIsValid
(
RecPtr
.
xrecoff
))
elog
(
STOP
,
"Invalid checkPoint in control file"
);
...
...
@@ -1460,6 +1479,8 @@ tryAgain:
StopIfError
=
sie_saved
;
}
#endif
/* NOT_USED */
ControlFile
->
state
=
DB_IN_PRODUCTION
;
ControlFile
->
time
=
time
(
NULL
);
UpdateControlFile
();
...
...
@@ -1486,6 +1507,7 @@ ShutdownXLOG()
void
CreateCheckPoint
(
bool
shutdown
)
{
#ifdef NOT_USED
CheckPoint
checkPoint
;
XLogRecPtr
recptr
;
XLogCtlInsert
*
Insert
=
&
XLogCtl
->
Insert
;
...
...
@@ -1548,10 +1570,19 @@ CreateCheckPoint(bool shutdown)
XLogFlush
(
recptr
);
#endif
/* NOT_USED */
SpinAcquire
(
ControlFileLockId
);
if
(
shutdown
)
ControlFile
->
state
=
DB_SHUTDOWNED
;
#ifdef NOT_USED
ControlFile
->
checkPoint
=
MyLastRecPtr
;
#else
ControlFile
->
checkPoint
.
xlogid
=
0
;
ControlFile
->
checkPoint
.
xrecoff
=
SizeOfXLogPHD
;
#endif
ControlFile
->
time
=
time
(
NULL
);
UpdateControlFile
();
SpinRelease
(
ControlFileLockId
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment