Skip to content

Commit e6095de

Browse files
committed
zero dest_id is pretty legal
1 parent cd997f9 commit e6095de

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/pglogical_apply.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,7 @@ mtm_send_reply(TransactionId xid, int node_id, MtmMessageCode msg_code)
854854
MtmLock(LW_SHARED);
855855
dest_id = Mtm->dmq_dest_ids[node_id - 1];
856856
MtmUnlock();
857+
Assert(dest_id >= 0);
857858

858859
MtmInitMessage(&msg, msg_code);
859860
msg.dxid = xid;

src/resolver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ scatter_status_requests(MtmConfig *mtm_cfg)
408408
MtmLock(LW_SHARED);
409409
dest_id = Mtm->dmq_dest_ids[node_id - 1];
410410
MtmUnlock();
411-
Assert(dest_id > 0);
411+
Assert(dest_id >= 0);
412412

413413
dmq_push_buffer(dest_id, "txreq", &msg,
414414
sizeof(MtmArbiterMessage));

src/state.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ check_status_requests(MtmConfig *mtm_cfg)
983983
MtmLock(LW_SHARED);
984984
dest_id = Mtm->dmq_dest_ids[sender_node_id - 1];
985985
MtmUnlock();
986-
Assert(dest_id > 0);
986+
Assert(dest_id >= 0);
987987

988988
// XXX: and define channels as strings too
989989
dmq_push_buffer(dest_id, "txresp", msg,

0 commit comments

Comments
 (0)