Content-Length: 262604 | pFad | http://github.com/postgrespro/postgres_cluster/commit/cdc172076badc220e5128665c7943ab178142706

77 Fix a comparison with garbage in Raft update processing code. · postgrespro/postgres_cluster@cdc1720 · GitHub
Skip to content

Commit cdc1720

Browse files
committed
Fix a comparison with garbage in Raft update processing code.
1 parent cc5f0f3 commit cdc1720

File tree

1 file changed

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

1 file changed

+2
-2
lines changed

contrib/raftable/raft/src/raft.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -814,8 +814,8 @@ static void raft_handle_update(raft_t r, raft_msg_update_t *m) {
814814

815815
if (!m->empty && !m->snapshot && !raft_appendable(r, m->previndex, m->prevterm)) goto finish;
816816

817-
if (reply.progress.entries > 0) {
818-
reply.term = RAFT_LOG(r, reply.progress.entries - 1).term;
817+
if (RAFT_LOG_LAST_INDEX(r) >= 0) {
818+
reply.term = RAFT_LOG(r, RAFT_LOG_LAST_INDEX(r)).term;
819819
} else {
820820
reply.term = -1;
821821
}

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/cdc172076badc220e5128665c7943ab178142706

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy