Skip to content

Commit 1fa450d

Browse files
authored
Panic on receiving higher term (#176)
1 parent 7faa67c commit 1fa450d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/backend/replication/walproposer.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,6 +1762,14 @@ RecvAppendResponses(Safekeeper *sk)
17621762
LSN_FORMAT_ARGS(sk->appendResponse.commitLsn),
17631763
sk->host, sk->port)));
17641764

1765+
if (sk->appendResponse.term > propTerm)
1766+
{
1767+
/* Another compute with higher term is running. */
1768+
elog(PANIC, "WAL acceptor %s:%s with term " INT64_FORMAT " rejected our request, our term " INT64_FORMAT "",
1769+
sk->host, sk->port,
1770+
sk->appendResponse.term, propTerm);
1771+
}
1772+
17651773
readAnything = true;
17661774
}
17671775

0 commit comments

Comments
 (0)