Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit429d225

Browse files
committed
GUC: DMQ Heartbeat timeout
1 parent0810e1f commit429d225

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

‎contrib/pg_exchange/dmq.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ static shmem_startup_hook_type PreviousShmemStartupHook;
129129
dmq_receiver_hook_typedmq_receiver_start_hook;
130130
dmq_receiver_hook_typedmq_receiver_stop_hook;
131131

132+
intdmq_heartbeat_timeout;
132133
voiddmq_sender_main(Datummain_arg);
133134

134135
PG_FUNCTION_INFO_V1(dmq_receiver_loop);
@@ -1138,9 +1139,9 @@ dmq_receiver_loop(PG_FUNCTION_ARGS)
11381139
// XXX: is it enough?
11391140
CHECK_FOR_INTERRUPTS();
11401141

1141-
if (dmq_now()-last_message_at>2000)
1142+
if (dmq_now()-last_message_at>dmq_heartbeat_timeout)
11421143
{
1143-
mtm_log(ERROR,"[DMQ] exit receiver due toheatbeat timeout");
1144+
mtm_log(ERROR,"[DMQ] exit receiver due toheartbeat timeout");
11441145
}
11451146

11461147
}

‎contrib/pg_exchange/dmq.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ typedef int8 DmqSenderId;
1919
#defineDMQ_MAX_DESTINATIONS 127
2020
#defineDMQ_MAX_RECEIVERS 100
2121

22+
externintdmq_heartbeat_timeout;
23+
2224
externvoiddmq_init(constchar*library_name);
2325

2426
externDmqDestinationIddmq_destination_add(char*connstr,

‎contrib/pg_exchange/pg_exchange.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,18 @@ _PG_init(void)
8080
NULL,
8181
NULL);
8282

83+
DefineCustomIntVariable("dmq_heartbeat_timeout",
84+
"Max timeout between heartbeat messages",
85+
NULL,
86+
&dmq_heartbeat_timeout,
87+
20000,
88+
1,INT_MAX,
89+
PGC_USERSET,
90+
GUC_UNIT_MS,
91+
NULL,
92+
NULL,
93+
NULL);
94+
8395
EXCHANGE_Init_methods();
8496
DUMMYSCAN_Init_methods();
8597
EXEC_Hooks_init();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp