projects
/
users
/
rhaas
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1d6a7a4
)
More robust KeepLogSeg() coding
author
Andres Freund
<andres@anarazel.de>
Wed, 29 Jan 2014 12:56:55 +0000
(13:56 +0100)
committer
Andres Freund
<andres@anarazel.de>
Wed, 29 Jan 2014 12:56:55 +0000
(13:56 +0100)
src/backend/access/transam/xlog.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/access/transam/xlog.c
b/src/backend/access/transam/xlog.c
index a77ff5fe5e9aade1f949fecfa8091f5718bb8258..ee1c0a31130da42a70e61ef9c241d470935f2833 100644
(file)
--- a/
src/backend/access/transam/xlog.c
+++ b/
src/backend/access/transam/xlog.c
@@
-9000,7
+9000,7
@@
CreateRestartPoint(int flags)
static void
KeepLogSeg(XLogRecPtr recptr, XLogSegNo *logSegNo)
{
- XLogSegNo segno
, slotSegNo
;
+ XLogSegNo segno;
XLogRecPtr keep;
XLByteToSeg(recptr, segno);
@@
-9019,9
+9019,13
@@
KeepLogSeg(XLogRecPtr recptr, XLogSegNo *logSegNo)
/* then check whether slots limit removal further */
if (max_replication_slots > 0 && keep != InvalidXLogRecPtr)
{
- XLByteToPrevSeg(keep, slotSegNo);
+ XLogRecPtr slotSegNo;
+
+ XLByteToSeg(keep, slotSegNo);
- if (slotSegNo < segno)
+ if (slotSegNo <= 0)
+ segno = 1;
+ else if (slotSegNo < segno)
segno = slotSegNo;
}