Content-Length: 261065 | pFad | http://github.com/postgrespro/postgres_cluster/commit/56ed20aeeb5453b9a9645f3da401d919cea449c9

5F Prevent Raft followers from applying entries which they have not rece… · postgrespro/postgres_cluster@56ed20a · GitHub
Skip to content

Commit 56ed20a

Browse files
committed
Prevent Raft followers from applying entries which they have not received yet.
1 parent 1552662 commit 56ed20a

File tree

1 file changed

+1
-1
lines changed
  • contrib/raftable/raft/src

1 file changed

+1
-1
lines changed

contrib/raftable/raft/src/raft.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ bool raft_peer_up(raft_t r, int id, char *host, int port, bool self) {
320320
static int raft_apply(raft_t raft) {
321321
int applied_now = 0;
322322
raft_log_t *l = &raft->log;
323-
while (l->applied < l->acked) {
323+
while ((l->applied < l->acked) && (l->applied <= RAFT_LOG_LAST_INDEX(raft))) {
324324
raft_entry_t *e = &RAFT_LOG(raft, l->applied);
325325
assert(e->update.len == e->bytes);
326326
raft->config.applier(raft->config.userdata, e->update, false);

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/56ed20aeeb5453b9a9645f3da401d919cea449c9

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy