On 2020/07/08 11:55, torikoshia wrote:
On 2020-07-08 11:15, Fujii Masao wrote:
On 2020/07/08 11:02, torikoshia wrote:
Hi,

Currently, slot_keep_segs is defined as "XLogRecPtr" in KeepLogSeg(),
but it seems that should be "XLogSegNo" because this variable is
segment number.

How do you think?

I agree that using XLogRecPtr for slot_keep_segs is incorrect.
But this variable indicates the number of segments rather than
segment no, uint64 seems better. Thought?

That makes sense.
The number of segments and segment number are different.

Yes, so patch attached. I will commit it later.

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
diff --git a/src/backend/access/transam/xlog.c 
b/src/backend/access/transam/xlog.c
index c2feb92576..3ebf8caee9 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -9601,7 +9601,7 @@ KeepLogSeg(XLogRecPtr recptr, XLogSegNo *logSegNo)
                /* Cap by max_slot_wal_keep_size ... */
                if (max_slot_wal_keep_size_mb >= 0)
                {
-                       XLogRecPtr      slot_keep_segs;
+                       uint64  slot_keep_segs;
 
                        slot_keep_segs =
                                ConvertToXSegs(max_slot_wal_keep_size_mb, 
wal_segment_size);

Reply via email to