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

Commit b3a0c79

Browse files
kvapkelvich
authored andcommitted
Add MtmNodeId range check.
1 parent b3225a3 commit b3a0c79

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

multimaster.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -1869,7 +1869,10 @@ static void MtmSplitConnStrs(void)
18691869
}
18701870
if (i > MAX_NODES) {
18711871
elog(ERROR, "Multimaster with more than %d nodes is not currently supported", MAX_NODES);
1872-
}
1872+
}
1873+
if (MtmNodeId > i) {
1874+
elog(ERROR, "Multimaster node id %d is out of range [%d..%d]", MtmNodeId, 1, i);
1875+
}
18731876
if (i < 2) {
18741877
elog(ERROR, "Multimaster should have at least two nodes");
18751878
}

0 commit comments

Comments
 (0)