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
5dd04603
Commit
5dd04603
authored
Mar 14, 2001
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't go belly-up if fork() fails for a routine checkpoint subprocess.
Just try again later.
parent
286d1fc3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
+20
-4
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+20
-4
No files found.
src/backend/postmaster/postmaster.c
View file @
5dd04603
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.2
09 2001/03/13 01:17:05
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.2
10 2001/03/14 17:58:46
tgl Exp $
*
*
* NOTES
* NOTES
*
*
...
@@ -804,6 +804,11 @@ ServerLoop(void)
...
@@ -804,6 +804,11 @@ ServerLoop(void)
{
{
/* Time to make the checkpoint... */
/* Time to make the checkpoint... */
CheckPointPID
=
CheckPointDataBase
();
CheckPointPID
=
CheckPointDataBase
();
/* if fork failed, schedule another try at 0.1 normal delay */
if
(
CheckPointPID
==
0
)
{
checkpointed
=
now
-
(
9
*
CheckPointTimeout
)
/
10
;
}
}
}
}
}
...
@@ -2124,6 +2129,7 @@ schedule_checkpoint(SIGNAL_ARGS)
...
@@ -2124,6 +2129,7 @@ schedule_checkpoint(SIGNAL_ARGS)
Shutdown
==
NoShutdown
&&
!
FatalError
)
Shutdown
==
NoShutdown
&&
!
FatalError
)
{
{
CheckPointPID
=
CheckPointDataBase
();
CheckPointPID
=
CheckPointDataBase
();
/* note: if fork fails, CheckPointPID stays 0; nothing happens */
}
}
errno
=
save_errno
;
errno
=
save_errno
;
...
@@ -2264,6 +2270,9 @@ InitSSL(void)
...
@@ -2264,6 +2270,9 @@ InitSSL(void)
/*
/*
* Fire off a subprocess for startup/shutdown/checkpoint.
* Fire off a subprocess for startup/shutdown/checkpoint.
*
* Return value is subprocess' PID, or 0 if failed to start subprocess
* (0 is returned only for checkpoint case).
*/
*/
static
pid_t
static
pid_t
SSDataBase
(
int
xlop
)
SSDataBase
(
int
xlop
)
...
@@ -2332,8 +2341,15 @@ SSDataBase(int xlop)
...
@@ -2332,8 +2341,15 @@ SSDataBase(int xlop)
fprintf
(
stderr
,
"%s Data Base: fork failed: %s
\n
"
,
fprintf
(
stderr
,
"%s Data Base: fork failed: %s
\n
"
,
((
xlop
==
BS_XLOG_STARTUP
)
?
"Startup"
:
((
xlop
==
BS_XLOG_STARTUP
)
?
"Startup"
:
((
xlop
==
BS_XLOG_CHECKPOINT
)
?
"CheckPoint"
:
((
xlop
==
BS_XLOG_CHECKPOINT
)
?
"CheckPoint"
:
"Shutdown"
)),
strerror
(
errno
));
"Shutdown"
)),
strerror
(
errno
));
/*
* fork failure is fatal during startup/shutdown, but there's
* no need to choke if a routine checkpoint fails.
*/
if
(
xlop
==
BS_XLOG_CHECKPOINT
)
return
0
;
ExitPostmaster
(
1
);
ExitPostmaster
(
1
);
}
}
...
@@ -2363,7 +2379,7 @@ SSDataBase(int xlop)
...
@@ -2363,7 +2379,7 @@ SSDataBase(int xlop)
TouchSocketLockFile
();
TouchSocketLockFile
();
}
}
return
(
pid
)
;
return
pid
;
}
}
...
...
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