Skip to content

Commit

Permalink
add: remove invariants package
Browse files Browse the repository at this point in the history
  • Loading branch information
coufalja committed Jun 9, 2024
1 parent b3b4e0b commit 12ffe2c
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 65 deletions.
22 changes: 0 additions & 22 deletions raft/internal/invariants/norace.go

This file was deleted.

21 changes: 0 additions & 21 deletions raft/internal/invariants/race.go

This file was deleted.

15 changes: 0 additions & 15 deletions raft/internal/tan/logdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,21 +161,6 @@ func (l *LogDB) cleanupBootstrapDir() error {
return nil
}

// TODO: remove the following two methods

// DeleteSnapshot ...
func (l *LogDB) DeleteSnapshot(shardID uint64,
replicaID uint64, index uint64) error {
panic("depreciated")
}

// ListSnapshots lists available snapshots associated with the specified
// Raft node for index range (0, index].
func (l *LogDB) ListSnapshots(shardID uint64,
replicaID uint64, index uint64) ([]pb.Snapshot, error) {
panic("depreciated")
}

// Name returns the type name of the ILogDB instance.
func (l *LogDB) Name() string {
return tanLogDBName
Expand Down
7 changes: 0 additions & 7 deletions raft/nodehost_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import (
"github.com/jamf/regatta/raft/config"
"github.com/jamf/regatta/raft/internal/fileutil"
"github.com/jamf/regatta/raft/internal/id"
"github.com/jamf/regatta/raft/internal/invariants"
"github.com/jamf/regatta/raft/internal/registry"
"github.com/jamf/regatta/raft/internal/rsm"
"github.com/jamf/regatta/raft/internal/server"
Expand Down Expand Up @@ -131,17 +130,11 @@ func calcRTTMillisecond(fs vfs.IFS, dir string) uint64 {
// typical proposal timeout
func pto(nh *NodeHost) time.Duration {
rtt := nh.NodeHostConfig().RTTMillisecond
if invariants.Race {
return 5 * time.Second
}
return time.Duration(rtt*45) * time.Millisecond
}

func lpto(nh *NodeHost) time.Duration {
rtt := nh.NodeHostConfig().RTTMillisecond
if invariants.Race {
return 30 * time.Second
}
return time.Duration(rtt*100) * time.Millisecond
}

Expand Down

0 comments on commit 12ffe2c

Please sign in to comment.