Skip to content

Commit

Permalink
Panic on receiving higher term (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
petuhovskiy authored and MMeent committed Feb 10, 2023
1 parent 60e3d0d commit 81bbf69
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/backend/replication/walproposer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1762,6 +1762,14 @@ RecvAppendResponses(Safekeeper *sk)
LSN_FORMAT_ARGS(sk->appendResponse.commitLsn),
sk->host, sk->port)));

if (sk->appendResponse.term > propTerm)
{
/* Another compute with higher term is running. */
elog(PANIC, "WAL acceptor %s:%s with term " INT64_FORMAT " rejected our request, our term " INT64_FORMAT "",
sk->host, sk->port,
sk->appendResponse.term, propTerm);
}

readAnything = true;
}

Expand Down

0 comments on commit 81bbf69

Please sign in to comment.