Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 878d7de

Browse files
committed
Push responses to WAL sender
1 parent af5de43 commit 878d7de

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

contrib/mmts/pglogical_receiver.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ feTimestampDifference(int64 start_time, int64 stop_time,
193193

194194
static char const* const MtmReplicationModeName[] =
195195
{
196-
"exit",
196+
"exit",
197197
"recovered", /* recovery of node is completed so drop old slot and restart replication from the current position in WAL */
198198
"recovery", /* perform recorvery of the node by applying all data from theslot from specified point */
199199
"normal" /* normal mode: use existed slot or create new one and start receiving data from it from the specified position */
@@ -558,7 +558,13 @@ pglogical_receiver_main(Datum main_arg)
558558
timeoutptr = &timeout;
559559

560560
r = select(PQsocket(conn) + 1, &input_mask, NULL, NULL, timeoutptr);
561-
if (r == 0 || (r < 0 && errno == EINTR))
561+
if (r == 0)
562+
{
563+
int64 now = feGetCurrentTimestamp();
564+
sendFeedback(conn, now, nodeId);
565+
continue;
566+
}
567+
else if (r < 0 && errno == EINTR)
562568
{
563569
/*
564570
* Got a timeout or signal. Continue the loop and either

0 commit comments

Comments
 (0)