-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathreplication_config.go
53 lines (44 loc) · 1.41 KB
/
replication_config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package ranje
// TODO: Move this into the keyspace package.
type ReplicationConfig struct {
// The number of active placements that a range should aim to have, when the
// keyspace is stable. Whether the number of active placements is more or
// fewer than this during operations depends on MinActive and MaxActive.
TargetActive int
// The minimum number of active placements that a range will ever be allowed
// to voluntarily have. (Sometimes the number will be lower involuntarily,
// because of e.g. nodes crashing.)
MinActive int
// The maximum number of active placements that a range will ever be allowed
// to have.
MaxActive int
// TODO
MinPlacements int
// TODO
MaxPlacements int
}
// TODO: Docs
func (rc *ReplicationConfig) Validate() error {
return nil
}
// R1 is an example replication config for systems which want a single active
// placement of each key, and can tolerate an additional inactive placement.
var R1 = ReplicationConfig{
TargetActive: 1,
MinActive: 0,
MaxActive: 1,
//
MinPlacements: 1,
MaxPlacements: 2,
}
// R1 is an example replication config for high-availability systems which want
// to maintain three active placements of each key, can tolerate an additional
// two placements during operations, one of which can be active.
var R3 = ReplicationConfig{
TargetActive: 3,
MinActive: 3,
MaxActive: 4,
//
MinPlacements: 3,
MaxPlacements: 5, // Up to two spare
}