Content-Length: 271322 | pFad | http://github.com/postgrespro/postgres_cluster/commit/112c9ec0179e31db550ebb63abec7f5d46f29f5a

07 Make leader reset the byte progress of peers that were receiving the … · postgrespro/postgres_cluster@112c9ec · GitHub
Skip to content

Commit 112c9ec

Browse files
committed
Make leader reset the byte progress of peers that were receiving the compacted entries.
1 parent 5edb28f commit 112c9ec

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/raft.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,15 @@ static int raft_compact(raft_t raft) {
639639
e->bytes = e->update.len;
640640
e->snapshot = true;
641641
assert(l->first == l->applied - 1);
642+
643+
// reset bytes progress of peers that were receiving the compacted entries
644+
for (int i = 0; i < raft->config.peernum_max; i++) {
645+
raft_peer_t *p = raft->peers + i;
646+
if (!p->up) continue;
647+
if (i == raft->me) continue;
648+
if (p->acked.entries + 1 <= l->first)
649+
p->acked.bytes = 0;
650+
}
642651
}
643652
return compacted;
644653
}

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/112c9ec0179e31db550ebb63abec7f5d46f29f5a

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy