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
3a087369
Commit
3a087369
authored
Feb 16, 2011
by
Robert Haas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WAL receiver shouldn't try to send a reply when dying.
Per report from, and discussion with, Fujii Masao.
parent
6e02755b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
src/backend/replication/walreceiver.c
src/backend/replication/walreceiver.c
+13
-7
No files found.
src/backend/replication/walreceiver.c
View file @
3a087369
...
...
@@ -118,7 +118,7 @@ static void DisableWalRcvImmediateExit(void);
static
void
WalRcvDie
(
int
code
,
Datum
arg
);
static
void
XLogWalRcvProcessMsg
(
unsigned
char
type
,
char
*
buf
,
Size
len
);
static
void
XLogWalRcvWrite
(
char
*
buf
,
Size
nbytes
,
XLogRecPtr
recptr
);
static
void
XLogWalRcvFlush
(
void
);
static
void
XLogWalRcvFlush
(
bool
dying
);
static
void
XLogWalRcvSendReply
(
void
);
/* Signal handlers */
...
...
@@ -319,7 +319,7 @@ WalReceiverMain(void)
* If we've written some records, flush them to disk and let the
* startup process know about them.
*/
XLogWalRcvFlush
();
XLogWalRcvFlush
(
false
);
}
else
{
...
...
@@ -342,7 +342,7 @@ WalRcvDie(int code, Datum arg)
volatile
WalRcvData
*
walrcv
=
WalRcv
;
/* Ensure that all WAL records received are flushed to disk */
XLogWalRcvFlush
();
XLogWalRcvFlush
(
true
);
SpinLockAcquire
(
&
walrcv
->
mutex
);
Assert
(
walrcv
->
walRcvState
==
WALRCV_RUNNING
||
...
...
@@ -461,7 +461,7 @@ XLogWalRcvWrite(char *buf, Size nbytes, XLogRecPtr recptr)
*/
if
(
recvFile
>=
0
)
{
XLogWalRcvFlush
();
XLogWalRcvFlush
(
false
);
/*
* XLOG segment files will be re-read by recovery in startup
...
...
@@ -531,9 +531,14 @@ XLogWalRcvWrite(char *buf, Size nbytes, XLogRecPtr recptr)
}
}
/* Flush the log to disk */
/*
* Flush the log to disk.
*
* If we're in the midst of dying, it's unwise to do anything that might throw
* an error, so we skip sending a reply in that case.
*/
static
void
XLogWalRcvFlush
(
void
)
XLogWalRcvFlush
(
bool
dying
)
{
if
(
XLByteLT
(
LogstreamResult
.
Flush
,
LogstreamResult
.
Write
))
{
...
...
@@ -565,7 +570,8 @@ XLogWalRcvFlush(void)
}
/* Also let the master know that we made some progress */
XLogWalRcvSendReply
();
if
(
!
dying
)
XLogWalRcvSendReply
();
}
}
...
...
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