Skip to content

Commit

Permalink
Revert "etcdserver: a non-empty raft log snapshot should always be av…
Browse files Browse the repository at this point in the history
…ailable"

This reverts commit a0c0639.
  • Loading branch information
clement2026 committed Aug 25, 2024
1 parent a0c0639 commit 86dc7a7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 82 deletions.
5 changes: 1 addition & 4 deletions server/etcdserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1210,10 +1210,7 @@ func (s *EtcdServer) triggerSnapshot(ep *etcdProgress) {
}

func (s *EtcdServer) shouldSnapshot(ep *etcdProgress) bool {
return (s.forceSnapshot && ep.appliedi != ep.snapi) ||
(ep.appliedi-ep.snapi > s.Cfg.SnapshotCount) ||
// ensures a non-empty snapshot always exists
(ep.snapi == 0 && ep.appliedi > ep.snapi)
return (s.forceSnapshot && ep.appliedi != ep.snapi) || (ep.appliedi-ep.snapi > s.Cfg.SnapshotCount)
}

func (s *EtcdServer) hasMultipleVotingMembers() bool {
Expand Down
78 changes: 0 additions & 78 deletions tests/integration/raft_log_snapshot_test.go

This file was deleted.

0 comments on commit 86dc7a7

Please sign in to comment.