Skip to content

Commit 5feffca

Browse files
committed
switch to GUC_UNIT_KB in size-related vars in mmts
1 parent 82808be commit 5feffca

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

contrib/mmts/multimaster.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2035,10 +2035,10 @@ MtmCheckSlots()
20352035
if (slot->in_use
20362036
&& sscanf(slot->data.name.data, MULTIMASTER_SLOT_PATTERN, &nodeId) == 1
20372037
&& BIT_CHECK(Mtm->disabledNodeMask, nodeId-1)
2038-
&& slot->data.confirmed_flush + MtmMaxRecoveryLag < GetXLogInsertRecPtr()
2038+
&& slot->data.confirmed_flush + MtmMaxRecoveryLag * 1024 < GetXLogInsertRecPtr()
20392039
&& slot->data.confirmed_flush != 0)
20402040
{
2041-
MTM_ELOG(WARNING, "Drop slot for node %d which lag %lld is larger than threshold %d",
2041+
MTM_ELOG(WARNING, "Drop slot for node %d which lag %lld B is larger than threshold %d kB",
20422042
nodeId,
20432043
(long64)(GetXLogInsertRecPtr() - slot->data.restart_lsn),
20442044
MtmMaxRecoveryLag);
@@ -2104,7 +2104,7 @@ void MtmCheckRecoveryCaughtUp(int nodeId, lsn_t slotLSN)
21042104
if (MtmIsRecoveredNode(nodeId)) {
21052105
lsn_t walLSN = GetXLogInsertRecPtr();
21062106
if (!BIT_CHECK(Mtm->originLockNodeMask, nodeId-1)
2107-
&& slotLSN + MtmMinRecoveryLag > walLSN)
2107+
&& slotLSN + MtmMinRecoveryLag * 1024 > walLSN)
21082108
{
21092109
/*
21102110
* Wal sender almost caught up.
@@ -2862,14 +2862,14 @@ _PG_init(void)
28622862
);
28632863
DefineCustomIntVariable(
28642864
"multimaster.trans_spill_threshold",
2865-
"Maximal size (Mb) of transaction after which transaction is written to the disk",
2865+
"Maximal size of transaction after which transaction is written to the disk",
28662866
NULL,
28672867
&MtmTransSpillThreshold,
2868-
100, /* 100Mb */
2869-
0,
2870-
MaxAllocSize/MB,
2871-
PGC_BACKEND,
2868+
100 * 1024, /* 100Mb */
28722869
0,
2870+
MaxAllocSize/GUC_UNIT_KB,
2871+
PGC_SIGHUP,
2872+
GUC_UNIT_KB,
28732873
NULL,
28742874
NULL,
28752875
NULL
@@ -2896,11 +2896,11 @@ _PG_init(void)
28962896
"When wal-sender almost catch-up WAL current position we need to stop 'Achilles tortile competition' and "
28972897
"temporary stop commit of new transactions until node will be completely repared",
28982898
&MtmMinRecoveryLag,
2899-
100000,
2900-
1,
2901-
INT_MAX,
2902-
PGC_BACKEND,
2899+
10 * 1024, /* 10 MB */
29032900
0,
2901+
INT_MAX,
2902+
PGC_SIGHUP,
2903+
GUC_UNIT_KB,
29042904
NULL,
29052905
NULL,
29062906
NULL
@@ -2912,11 +2912,11 @@ _PG_init(void)
29122912
"Dropping slot makes it not possible to recover node using logical replication mechanism, it will be ncessary to completely copy content of some other nodes "
29132913
"using basebackup or similar tool. Zero value of parameter disable dropping slot.",
29142914
&MtmMaxRecoveryLag,
2915-
100000000,
2915+
1 * 1024 * 1024, /* 1 GB */
29162916
0,
29172917
INT_MAX,
2918-
PGC_BACKEND,
2919-
0,
2918+
PGC_SIGHUP,
2919+
GUC_UNIT_KB,
29202920
NULL,
29212921
NULL,
29222922
NULL

0 commit comments

Comments
 (0)