aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlog.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2020-07-07 13:08:00 -0400
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2020-07-07 13:08:00 -0400
commitc54b5891f415df36809de1aeb97e4574d5456d69 (patch)
tree54c89c84b8ae4651bb9ba66254114ca8aa02b997 /src/backend/access/transam/xlog.c
parentda6b6ff95bcaadc109ab248471527a2511e853d5 (diff)
downloadpostgresql-c54b5891f415df36809de1aeb97e4574d5456d69.tar.gz
postgresql-c54b5891f415df36809de1aeb97e4574d5456d69.zip
Morph pg_replication_slots.min_safe_lsn to safe_wal_size
The previous definition of the column was almost universally disliked, so provide this updated definition which is more useful for monitoring purposes: a large positive value is good, while zero or a negative value means danger. This should be operationally more convenient. Backpatch to 13, where the new column to pg_replication_slots (and the feature it represents) were added. Author: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Author: Álvaro Herrera <alvherre@alvh.no-ip.org> Reported-by: Fujii Masao <masao.fujii@oss.nttdata.com> Discussion: https://postgr.es/m/9ddfbf8c-2f67-904d-44ed-cf8bc5916228@oss.nttdata.com
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r--src/backend/access/transam/xlog.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index d5dfd5764e6..f5df1025134 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -764,8 +764,7 @@ static ControlFileData *ControlFile = NULL;
* Convert values of GUCs measured in megabytes to equiv. segment count.
* Rounds down.
*/
-#define ConvertToXSegs(x, segsize) \
- ((x) / ((segsize) / (1024 * 1024)))
+#define ConvertToXSegs(x, segsize) XLogMBVarToSegs((x), (segsize))
/* The number of bytes in a WAL segment usable for WAL data. */
static int UsableBytesInSegment;
@@ -9513,8 +9512,7 @@ GetWALAvailability(XLogRecPtr targetLSN)
XLogSegNo targetSeg; /* segid of targetLSN */
XLogSegNo oldestSeg; /* actual oldest segid */
XLogSegNo oldestSegMaxWalSize; /* oldest segid kept by max_wal_size */
- XLogSegNo oldestSlotSeg = InvalidXLogRecPtr; /* oldest segid kept by
- * slot */
+ XLogSegNo oldestSlotSeg; /* oldest segid kept by slot */
uint64 keepSegs;
/*